byte数组和int类型的转换
byte[] -> int 四位的byte数组转为Int值
int len = (lenBuff[0] & 0x00ff) <<24 | (lenBuff[1] & 0x00ff) <<16 | (lenBuff[2] & 0x00ff) <<8 | (lenBuff[3] & 0x00ff)
int -> byte[]
byte[] bytes = new bytes[];
bytes[0] = (byte) (len >>24);
bytes[1] = (byte) (len >>16);
bytes[2] = (byte) (len >>8);
bytes[3] = (byte) (len);
byte[] -> int 四位的byte数组转为Int值
int len = (lenBuff[0] & 0x00ff) <<24 | (lenBuff[1] & 0x00ff) <<16 | (lenBuff[2] & 0x00ff) <<8 | (lenBuff[3] & 0x00ff)
int -> byte[]
byte[] bytes = new bytes[];
bytes[0] = (byte) (len >>24);
bytes[1] = (byte) (len >>16);
bytes[2] = (byte) (len >>8);
bytes[3] = (byte) (len);