int型转换成byte型
public static byte[] intToByteArray1(int i) {//一个int型占四个字节,32位
byte[] result = new byte[4]; //JAVA 高位在后,低位在前
result[3] = (byte)((i >> 24) & 0xFF);
result[2] = (byte)((i >> 16) & 0xFF);
result[1] = (byte)((i >> 8) & 0xFF);
result[0] = (byte)(i & 0xFF);
return result;
}