@Test
public void testLimit() {

   byte[] data = new byte[] {1, 2};
   ByteBuf byteBuffer = Unpooled.wrappedBuffer(data);
   NettyReadable buffer = new NettyReadable(byteBuffer);
   assertEquals(data.length, buffer.limit());
   buffer.limit(1);
   assertEquals(1, buffer.limit());
   assertEquals(1, buffer.get());
   assertFalse(buffer.hasRemaining());
   try {
      buffer.get();
      fail("Should throw an IndexOutOfBoundsException");
   } catch (IndexOutOfBoundsException ioe) {
   }
}