@Override public final int readableBytes() { return wrapped.readableBytes(); }
@Override public final int readableBytes() { return wrapped.readableBytes(); }
@Override public final int readableBytes() { return wrapped.readableBytes(); }
@Override public ByteBuffer[] nioBuffers() { return nioBuffers(readerIndex(), readableBytes()); }
@Override public ByteBuffer[] nioBuffers() { return nioBuffers(readerIndex(), readableBytes()); }
@Override protected ByteBuf composeFirst(ByteBufAllocator allocator, ByteBuf first) { if (first instanceof CompositeByteBuf) { CompositeByteBuf composite = (CompositeByteBuf) first; first = allocator.directBuffer(composite.readableBytes()); try { first.writeBytes(composite); } catch (Throwable cause) { first.release(); PlatformDependent.throwException(cause); } composite.release(); } return first; }
@Override public ByteBuffer[] nioBuffers() { return nioBuffers(readerIndex(), readableBytes()); }
@Override public void call(CompositeByteBuf collector, ByteBuf buf) { long newLength = collector.readableBytes() + buf.readableBytes(); if (newLength <= maxBytes) { collector.addComponent(true, buf); } else { collector.release(); buf.release(); throw new TooMuchDataException("More than " + maxBytes + "B received"); } } }
@Override protected ByteBuf composeFirst(ByteBufAllocator allocator, ByteBuf first) { if (first instanceof CompositeByteBuf) { CompositeByteBuf composite = (CompositeByteBuf) first; first = allocator.directBuffer(composite.readableBytes()); try { first.writeBytes(composite); } catch (Throwable cause) { first.release(); PlatformDependent.throwException(cause); } composite.release(); } return first; }
final C m = (C) msg; if (content.readableBytes() > maxContentLength - m.content().readableBytes()) {
int realLength = fullCompressedContent.readableBytes() - FRAME_TAIL.length; compressedContent = fullCompressedContent.slice(0, realLength); } else {
@Override public final int readableBytes() { return wrapped.readableBytes(); }
final C m = (C) msg; if (content.readableBytes() > maxContentLength - m.content().readableBytes()) {
final C m = (C) msg; if (content.readableBytes() > maxContentLength - m.content().readableBytes()) {
@Override protected ByteBuf composeFirst(ByteBufAllocator allocator, ByteBuf first) { if (first instanceof CompositeByteBuf) { CompositeByteBuf composite = (CompositeByteBuf) first; first = allocator.directBuffer(composite.readableBytes()); try { first.writeBytes(composite); } catch (Throwable cause) { first.release(); PlatformDependent.throwException(cause); } composite.release(); } return first; }
@Override public ByteBuffer[] nioBuffers() { return nioBuffers(readerIndex(), readableBytes()); }
@Override public final int readableBytes() { return wrapped.readableBytes(); }
@Override public final int readableBytes() { return wrapped.readableBytes(); }
@Override public ByteBuffer[] nioBuffers() { return nioBuffers(readerIndex(), readableBytes()); }
private static ByteBuf newCompositeBuffer(ByteBufAllocator alloc) { CompositeByteBuf compositeByteBuf = alloc.compositeBuffer(); compositeByteBuf.addComponent(true, alloc.directBuffer(4).writeInt(100)); compositeByteBuf.addComponent(true, alloc.directBuffer(8).writeLong(123)); compositeByteBuf.addComponent(true, alloc.directBuffer(8).writeLong(456)); assertEquals(EXPECTED_BYTES, compositeByteBuf.readableBytes()); return compositeByteBuf; }