使用Java NIO的ByteBuffer非常简单:
byte[] bytes = ByteBuffer.allocate(4).putInt(1695609641).array();for (byte b : bytes) { System.out.format("0x%x ", b);}输出:
0x65 0x10 0xf3 0x29

使用Java NIO的ByteBuffer非常简单:
byte[] bytes = ByteBuffer.allocate(4).putInt(1695609641).array();for (byte b : bytes) { System.out.format("0x%x ", b);}输出:
0x65 0x10 0xf3 0x29