public static void main(String[] args) { ByteBuffer buf = ByteBuffer.allocate(8); buf.put(new byte[] { 0, 0, 1, 0, 2, 0, 0, 3 }); buf.rewind(); System.out.println(readOffset(0, buf.asLongBuffer())); buf.rewind(); System.out.println(readNameLength(0, buf.asLongBuffer())); buf.rewind(); System.out.println(readLength(0, buf.asLongBuffer())); } }