@Test public void testGetReadLong() { ByteBuf buf = buffer(((ByteBuffer) allocate(16).putLong(1).putLong(2).flip()).asReadOnlyBuffer()); Assert.assertEquals(1, buf.getLong(0)); Assert.assertEquals(2, buf.getLong(8)); Assert.assertEquals(1, buf.readLong()); Assert.assertEquals(2, buf.readLong()); Assert.assertFalse(buf.isReadable()); }
@Override public long readLong() { return buf.readLong(); }