Deserializer { public long readLong() { _detectBufferUnderflow(8); long l = BigEndianCodec.getLong(_buffer, _index); _index += 8; return l; } Deserializer(ByteBuffer byteBuffer); boolean readBoolean(); byte readByte(); char readChar(); double readDouble(); float readFloat(); int readInt(); long readLong(); T readObject(); short readShort(); String readString();  }
@Test public void testReadLong() { ByteBuffer byteBuffer = ByteBuffer.allocate(_COUNT * 8); byteBuffer.order(ByteOrder.BIG_ENDIAN); LongBuffer longBuffer = byteBuffer.asLongBuffer(); long[] longs = new long[_COUNT]; for (int i = 0; i < _COUNT; i++) { longs[i] = _random.nextLong(); longBuffer.put(longs[i]); } Deserializer deserializer = new Deserializer(byteBuffer); for (int i = 0; i < _COUNT; i++) { Assert.assertEquals(longs[i], deserializer.readLong()); } }