需求:数据报文长度占四字节,小端模式 public static byte[] int2ByteArrayLE(int myInteger){ return ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(myInteger).array(); } public static int byteArray2IntLE(byte