@Test public void testEmptyBuffersAreCoalesced() { ByteBuf empty = Unpooled.buffer(0, 1); assertQueueSize(0, true); writeQueue.add(cat, catPromise); writeQueue.add(empty, emptyPromise); assertQueueSize(3, false); DefaultChannelPromise aggregatePromise = newPromise(); assertEquals("cat", dequeue(3, aggregatePromise)); assertQueueSize(0, true); assertFalse(catPromise.isSuccess()); assertFalse(emptyPromise.isSuccess()); aggregatePromise.setSuccess(); assertTrue(catPromise.isSuccess()); assertTrue(emptyPromise.isSuccess()); assertEquals(0, cat.refCnt()); assertEquals(0, empty.refCnt()); }
public void add(ByteBuf buf) { add(buf, (ChannelFutureListener) null); }
CoalescingBufferQueue { public void add(ByteBuf buf) { add(buf, (ChannelFutureListener) null); } }
CoalescingBufferQueue { public void add(ByteBuf buf) { add(buf, (ChannelFutureListener) null); } CoalescingBufferQueue(Channel channel);  CoalescingBufferQueue(Channel channel, int initSize); }
CoalescingBufferQueue { public void add(ByteBuf buf) { add(buf, (ChannelFutureListener) null); } CoalescingBufferQueue(Channel channel);  CoalescingBufferQueue(Channel channel, int initSize); void add(ByteBuf buf); void add(ByteBuf buf, ChannelPromise promise); void add(ByteBuf buf, ChannelFutureListener listener); ByteBuf remove(int bytes, ChannelPromise aggregatePromise); int readableBytes(); boolean isEmpty(); void releaseAndFailAll(Throwable cause); void copyTo(CoalescingBufferQueue dest); }
CoalescingBufferQueue { public void add(ByteBuf buf) { add(buf, (ChannelFutureListener) null); } CoalescingBufferQueue(Channel channel);  CoalescingBufferQueue(Channel channel, int initSize); void add(ByteBuf buf); void add(ByteBuf buf, ChannelPromise promise); void add(ByteBuf buf, ChannelFutureListener listener); ByteBuf remove(int bytes, ChannelPromise aggregatePromise); int readableBytes(); boolean isEmpty(); void releaseAndFailAll(Throwable cause); void copyTo(CoalescingBufferQueue dest);  }