Byte Array
In this post we will learn about basic concept of byte array and how to covert a string into byte array.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
In this post we will learn about basic concept of byte array and how to covert a string into byte array.
Byte
Byte is a unit of digital information that contain mostly eight bit. The bit is a unit of information which can be either 0 or 1. Byte contains eight bit so its value range is 0 to 28 -1 i.e. 0 to 255.
Byte Array
Byte array is the array of byte.
Convert String into Byte Array
Example: convert string s = "ByteArray" into byte array
Step 1: Find ASCII value of each character in s and store in an array.
ASCII(ByteArray) = [66, 121, 116, 101, 65, 114, 114, 97, 121]
Byte array of s will be array of ASCII value.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Comments
Post a Comment