(due to the length of the reasons for the lack of detailed science, do not like to spray).
Often see different definitions of byte arrays in Java, roughly sorted:
A byte (byte) = 8 bit (bit), "byte array" is All "byte", that is, each byte can be represented in binary, 16, decimal.
Binary: 00010110----->0*2^8 + 0*2^7 + 0*2^6 + 1*2^5 + 0*2^4 + 1*2^3 + 1*2^2 + 0*2^1 + 0*2^0 = 22
16 in: 0x16------->1*16^1 + 6*16^0 = 22
Decimal: 22
So the following three are equivalent:
byte [] aa = {00010110, 01010010, 10111000};
byte [] aa = {0x16, 0x52, 0xb8};
byte [] aa = {22, 82, 184};
When the Eclipse breakpoint is debugged, the contents of the byte array you see are expressed in decimal notation. Sometimes you see negative numbers, because more than 127 of the bytes in the byte array are displayed as negative numbers.
We know that the way Java reads only supports byte arrays, and byte is 8 bits, so it cannot exceed 127, and if it overflows, it is displayed as a negative number.
The above article on the Java byte array of different writing is small to share all the content of the whole, hope to give you a reference, but also hope that we support the cloud habitat community.