1. Bytes:
The word (Byte) section is the length unit. Bit (bit) is also the unit of length.
Because computer communication and storage is based on 010101 of such binary data, where a 0 and 1 of the place is called bit (bit), that is, a
In Java, Byte uses a binary representation of 8 bits, and we know that each character of the 16 binary needs to be represented by a 4-bit bits (23 + 22 + 21 + 20 = 15), so we can convert each byte to two corresponding 16 characters, That is, the
Background Basics:1, character encoding related knowledge (transfer from http://blog.csdn.net/llwan/article/details/7567906)1.1, "character" is represented by a numberFirst to re-understand how the computer handles the "character", this principle is
BYTE-order, as the name implies the order of bytes, and then say two more than a byte type of data in memory storage order (a byte of data of course there is no need to talk about the order of the problem). In fact, most people in the actual
First, only string is associated with the encoding;
When converting between byte and other types, be aware of big or small endpoints.
Encoding: Ascii Unicode gbk utf-8 et cetera
A byte of 8 digits can be composed of two 16-digit (0XFF), a 16-bit
Link Source: 58603865*************************************************************************************************************** ****************Key points: 1, then python in the bottom of the byte are encoded, Python2 is the Assic code, Python3
Java IO stream byte stream, java IO stream byteI. Common file Operations
File file = new File ("E: \ test \ javaIo"); System. out. println (file. isDirectory (); // determines whether the file is a directory (if the file does not exist, false is
Original URL: http://www.xuebuyuan.com/988752.htmlThe conversion of Java byte to other data types is mainly used for encoding and decoding binary data, mainly for network transmission, reading and writing binary files, data communication between
1: "Byte" is byte, "bit" is bit;2:1 byte = 8 bit;Char is 2 bytes in Java. Java uses unicode,2 bytes (16 bits) to represent one character.ButString str = "compilation";byte[] bytes = Str.getbytes (); I wonder why it takes 3 bytes here?3 byte is 3*8=24
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.