您已经在注释中说过,您希望输入数组中的四个字节对应于输出数组中的一个整数,因此效果很好。
取决于您希望字节是大端还是小端顺序,但是…
IntBuffer intBuf = ByteBuffer.wrap(byteArray) .order(ByteOrder.BIG_ENDIAN) .asIntBuffer(); int[] array = new int[intBuf.remaining()]; intBuf.get(array);
完成,分为三行。

您已经在注释中说过,您希望输入数组中的四个字节对应于输出数组中的一个整数,因此效果很好。
取决于您希望字节是大端还是小端顺序,但是…
IntBuffer intBuf = ByteBuffer.wrap(byteArray) .order(ByteOrder.BIG_ENDIAN) .asIntBuffer(); int[] array = new int[intBuf.remaining()]; intBuf.get(array);
完成,分为三行。