ByteBuf byteBuf = internalBuffer();
Assert.assertEquals(1, byteBuf.refCnt());
in.readByte();
// Removal from pipeline should clear internal buffer
ctx.pipeline().remove(this);
Assert.assertEquals(0, byteBuf.refCnt());
}
});
Assert.assertTrue(channel.writeInbound(buf));
Assert.assertTrue(channel.finish());
Assert.assertEquals(channel.readInbound(), Unpooled.wrappedBuffer(new byte[] {'b'}));