您需要知道字节的字节序。
假设(例如@ WhiteFang34),其
bytes是一个
byte[]长度为4的,然后… …
大端:
int x = java.nio.ByteBuffer.wrap(bytes).getInt();
小端:
int x = java.nio.ByteBuffer.wrap(bytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt();

您需要知道字节的字节序。
假设(例如@ WhiteFang34),其
bytes是一个
byte[]长度为4的,然后… …
大端:
int x = java.nio.ByteBuffer.wrap(bytes).getInt();
小端:
int x = java.nio.ByteBuffer.wrap(bytes).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt();