Byte and byte[] Array, "represents a 8-bit unsigned integer, typically a 8-bit binary number."
Byte is the most basic storage unit and the most basic communication unit of a computer.
Why is it that byte is the most basic type?
In fact, the key is that the computer's most basic algorithm is coding, including media files, pictures, and various documents so that the computer has data of the file presentation are strings, and these strings are encoded.
Whether you are a variety of strange string format, and ultimately based on the encoding table, the character converted to the corresponding decimal number, and the corresponding decimal number that, it will be stored in the byte[] array (where the decimal number is used to calculate, the storage is automatically converted to binary digital storage, The program is calculated in decimal).
Media files, pictures, various documents and so on-"the source file consists of a string, multiple characters-" single character-"decimal number (according to the corresponding code)-" byte[] Array (single character)-"byte[" Array (multiple characters)-"media files, pictures, various documents and so on storage units or communication units."
At this point the "single character" binary length is based on the corresponding code, composed of multiple characters of the byte[] is composed of media files, pictures, various documents and other source files.
Specific as follows:
UTF-8 encoding : An English character equals one byte, and a Chinese (with traditional) equals three bytes.
Unicode encoding : one English equals two bytes, and one Chinese (with traditional) equals two bytes.
Below you can see the UTF-8 encoded byte[] array (C # byte[] default storage calculated as Decimal ), so the final computer data is based on a byte type that is composed of data.
Note: In the transmission process, the basic byte[] type can also do various encoding transmission, such as Base64 string, XML, JSON, HTML, and so on, but the million change is encoded and decoded.
Byte and byte[] arrays