Deserializer { public byte readByte() { _detectBufferUnderflow(1); return _buffer[_index++]; } 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 testReadByte() { byte[] bytes = new byte[_COUNT]; _random.nextBytes(bytes); ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); Deserializer deserializer = new Deserializer(byteBuffer); for (int i = 0; i < _COUNT; i++) { Assert.assertEquals(bytes[i], deserializer.readByte()); } }