
您需要知道字节的字节序。
假设(例如@ 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();
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)