Integer有个方法:static String toBinaryString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 2.
以及:static String toHexString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 16. BYTE转成INT的时候要注意一点负数的问题。
Creates a string representation of the integer argument as an unsigned integer in base 2.
以及:static String toHexString(int i)
Creates a string representation of the integer argument as an unsigned integer in base 16. BYTE转成INT的时候要注意一点负数的问题。
System.out.println(Integer.toBinaryString(b));//2
System.out.println(Integer.toHexString(b));//16
byte转换 int 从小到大的转换 好象没什么问题吧