Deserializer { public int readInt() { _detectBufferUnderflow(4); int i = BigEndianCodec.getInt(_buffer, _index); _index += 4; return i; } 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 testReadInt() { ByteBuffer byteBuffer = ByteBuffer.allocate(_COUNT * 4); byteBuffer.order(ByteOrder.BIG_ENDIAN); IntBuffer intBuffer = byteBuffer.asIntBuffer(); int[] ints = new int[_COUNT]; for (int i = 0; i < _COUNT; i++) { ints[i] = _random.nextInt(); intBuffer.put(ints[i]); } Deserializer deserializer = new Deserializer(byteBuffer); for (int i = 0; i < _COUNT; i++) { Assert.assertEquals(ints[i], deserializer.readInt()); } }