摘要:
一直搞不清楚整形变量与字节数组的转换,看过各位网友的解释,现写下此随笔:整形变量转换成字节数组 对于int类型变量a,将其转换为字节数组b,方法如下: int a = 100; byte[] b = byte[4]; b[3] = (byte)(a & 0xff); b[2] = (byte)(a>>8 & 0xff); b[1] = (byte)(a>>16 & 0xff); b[0] = (byte)(a>>24 & 0xff); 字节数组转换成整形变... 阅读全文