Deserializer { public boolean readBoolean() { _detectBufferUnderflow(1); return BigEndianCodec.getBoolean(_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 testReadBoolean() { byte[] bytes = new byte[_COUNT]; for (int i = 0; i < _COUNT; i++) { bytes[i] = _random.nextBoolean() ? (byte)1 : (byte)0; } ByteBuffer byteBuffer = ByteBuffer.wrap(bytes); Deserializer deserializer = new Deserializer(byteBuffer); for (int i = 0; i < _COUNT; i++) { if (bytes[i] == 0) { Assert.assertFalse(deserializer.readBoolean()); } else { Assert.assertTrue(deserializer.readBoolean()); } } }