@Test public void testReadByte() { byte[] bytes = new byte[] {12, 23, 34, 45, 56}; ByteBuf buf = Unpooled.wrappedBuffer(bytes); DynamicCompositeByteBuf compositeByteBuf = new DynamicCompositeByteBuf(buf); byte b = compositeByteBuf.readByte(); Assert.assertTrue(b == 12); Assert.assertTrue(compositeByteBuf.readableBytes() == 4); }
public byte readByte() { checkReadableBytes0(1); ByteBuf buf = buffers.peek(); byte res = buf.readByte(); readableBytes -= 1; if (buf.readableBytes() <= 0) { buffers.removeFirst().release(); } return res; }
DynamicCompositeByteBuf { public byte readByte() { checkReadableBytes0(1); ByteBuf buf = buffers.peek(); byte res = buf.readByte(); readableBytes -= 1; if (buf.readableBytes() <= 0) { buffers.removeFirst().release(); } return res; } }
DynamicCompositeByteBuf { public byte readByte() { checkReadableBytes0(1); ByteBuf buf = buffers.peek(); byte res = buf.readByte(); readableBytes -= 1; if (buf.readableBytes() <= 0) { buffers.removeFirst().release(); } return res; } DynamicCompositeByteBuf();  DynamicCompositeByteBuf(int capacity);  DynamicCompositeByteBuf(ByteBuf buf);  DynamicCompositeByteBuf(ByteBuf[] bufs, int offset, int len); }
DynamicCompositeByteBuf { public byte readByte() { checkReadableBytes0(1); ByteBuf buf = buffers.peek(); byte res = buf.readByte(); readableBytes -= 1; if (buf.readableBytes() <= 0) { buffers.removeFirst().release(); } return res; } DynamicCompositeByteBuf();  DynamicCompositeByteBuf(int capacity);  DynamicCompositeByteBuf(ByteBuf buf);  DynamicCompositeByteBuf(ByteBuf[] bufs, int offset, int len); int readableBytes(); boolean isEmpty(); boolean hasArray(); byte[] array(); int arrayOffset(); int readerIndex(); boolean isReadable(); ByteBuf nettyByteBuf(); void addBuffer(ByteBuf buffer); ByteBuf readRetainedSlice(int length); ByteBuf retainedSlice(int length); void skipBytes(int length); DynamicCompositeByteBuf readBytes(byte[] dst); DynamicCompositeByteBuf readBytes(byte[] dst, int dstIndex, int length); byte readByte(); short readUnsignedByte(); short readShort(); short readShortLE(); int readUnsignedShort(); int readUnsignedShortLE(); int readInt(); int readIntLE(); long readLong(); long readLongLE(); char readChar(); float readFloat(); float readFloatLE(); double readDouble(); double readDoubleLE(); ByteOrder order(); void release(); @Override String toString(); }
DynamicCompositeByteBuf { public byte readByte() { checkReadableBytes0(1); ByteBuf buf = buffers.peek(); byte res = buf.readByte(); readableBytes -= 1; if (buf.readableBytes() <= 0) { buffers.removeFirst().release(); } return res; } DynamicCompositeByteBuf();  DynamicCompositeByteBuf(int capacity);  DynamicCompositeByteBuf(ByteBuf buf);  DynamicCompositeByteBuf(ByteBuf[] bufs, int offset, int len); int readableBytes(); boolean isEmpty(); boolean hasArray(); byte[] array(); int arrayOffset(); int readerIndex(); boolean isReadable(); ByteBuf nettyByteBuf(); void addBuffer(ByteBuf buffer); ByteBuf readRetainedSlice(int length); ByteBuf retainedSlice(int length); void skipBytes(int length); DynamicCompositeByteBuf readBytes(byte[] dst); DynamicCompositeByteBuf readBytes(byte[] dst, int dstIndex, int length); byte readByte(); short readUnsignedByte(); short readShort(); short readShortLE(); int readUnsignedShort(); int readUnsignedShortLE(); int readInt(); int readIntLE(); long readLong(); long readLongLE(); char readChar(); float readFloat(); float readFloatLE(); double readDouble(); double readDoubleLE(); ByteOrder order(); void release(); @Override String toString();  }