Java转换整形(int)为字节数组(byte array),bytearray,public stati
分享于 点击 22350 次 点评:217
Java转换整形(int)为字节数组(byte array),bytearray,public stati
public static byte[] intToByteArray(int value) { byte[] b = new byte[4]; for (int i = 0; i < 4; i++) { int offset = (b.length - 1 - i) * 8; b[i] = (byte) ((value >>> offset) & 0xFF); } return b;}
用户点评