Home / Function/ testRemoveItselfWriteBuffer() — netty Function Reference

testRemoveItselfWriteBuffer() — netty Function Reference

Architecture documentation for the testRemoveItselfWriteBuffer() function in ByteToMessageDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2958e749_3d93_7b3e_0aa1_45be254190fe["testRemoveItselfWriteBuffer()"]
  b1c999fe_35fb_8b70_a958_296cffb0616a["ByteToMessageDecoderTest"]
  2958e749_3d93_7b3e_0aa1_45be254190fe -->|defined in| b1c999fe_35fb_8b70_a958_296cffb0616a
  5082856a_b229_862d_0072_81f9b24f56a3["EmbeddedChannel()"]
  2958e749_3d93_7b3e_0aa1_45be254190fe -->|calls| 5082856a_b229_862d_0072_81f9b24f56a3
  style 2958e749_3d93_7b3e_0aa1_45be254190fe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java lines 73–98

    @Test
    public void testRemoveItselfWriteBuffer() {
        final ByteBuf buf = Unpooled.buffer().writeBytes(new byte[] {'a', 'b', 'c'});
        EmbeddedChannel channel = new EmbeddedChannel(new ByteToMessageDecoder() {
            private boolean removed;

            @Override
            protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
                assertFalse(removed);
                in.readByte();
                ctx.pipeline().remove(this);

                // This should not let it keep call decode
                buf.writeByte('d');
                removed = true;
            }
        });

        channel.writeInbound(buf.copy());
        ByteBuf expected = Unpooled.wrappedBuffer(new byte[] {'b', 'c'});
        ByteBuf b = channel.readInbound();
        assertEquals(expected, b);
        expected.release();
        buf.release();
        b.release();
    }

Domain

Subdomains

Frequently Asked Questions

What does testRemoveItselfWriteBuffer() do?
testRemoveItselfWriteBuffer() is a function in the netty codebase, defined in codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java.
Where is testRemoveItselfWriteBuffer() defined?
testRemoveItselfWriteBuffer() is defined in codec-base/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java at line 73.
What does testRemoveItselfWriteBuffer() call?
testRemoveItselfWriteBuffer() calls 1 function(s): EmbeddedChannel.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free