@Test public void testGetReadInt() { ByteBuf buf = buffer(((ByteBuffer) allocate(8).putInt(1).putInt(2).flip()).asReadOnlyBuffer()); Assert.assertEquals(1, buf.getInt(0)); Assert.assertEquals(2, buf.getInt(4)); Assert.assertEquals(1, buf.readInt()); Assert.assertEquals(2, buf.readInt()); Assert.assertFalse(buf.isReadable()); }
@Override public int readInt() { return buf.readInt(); }