List of utility methods to do ByteBuffer to Long Array
long | getLongLE(final ByteBuffer b, final int start, final int end) Computes a number whereby the 1st byte is the least significant and the last byte is the most significant. long number = 0; for (int i = 0; i < (end - start + 1); i++) { number += ((b.get(start + i) & 0xFF) << i * 8); return number; |
long | getLongWithChecksum(ByteBuffer buffer, Adler32 checksum) get Long With Checksum final long value = buffer.getLong(); checksum.update((int) (value & 0xFFFFL)); checksum.update((int) (value >> 32)); return value; |