Home / Function/ testComponentAtOffset() — netty Function Reference

testComponentAtOffset() — netty Function Reference

Architecture documentation for the testComponentAtOffset() function in AbstractCompositeByteBufTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  8cdb5bc5_ccf5_ba2d_7f78_cb91d7610871["testComponentAtOffset()"]
  47bc0a20_e243_89ff_132b_99ac6b23835f["AbstractCompositeByteBufTest"]
  8cdb5bc5_ccf5_ba2d_7f78_cb91d7610871 -->|defined in| 47bc0a20_e243_89ff_132b_99ac6b23835f
  style 8cdb5bc5_ccf5_ba2d_7f78_cb91d7610871 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java lines 140–161

    @Test
    public void testComponentAtOffset() {
        CompositeByteBuf buf = (CompositeByteBuf) wrappedBuffer(new byte[]{1, 2, 3, 4, 5},
                new byte[]{4, 5, 6, 7, 8, 9, 26});

        //Ensure that a random place will be fine
        assertEquals(5, buf.componentAtOffset(2).capacity());

        //Loop through each byte

        byte index = 0;

        while (index < buf.capacity()) {
            ByteBuf _buf = buf.componentAtOffset(index++);
            assertNotNull(_buf);
            assertTrue(_buf.capacity() > 0);
            assertTrue(_buf.getByte(0) > 0);
            assertTrue(_buf.getByte(_buf.readableBytes() - 1) > 0);
        }

        buf.release();
    }

Domain

Subdomains

Frequently Asked Questions

What does testComponentAtOffset() do?
testComponentAtOffset() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java.
Where is testComponentAtOffset() defined?
testComponentAtOffset() is defined in buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java at line 140.

Analyze Your Own Codebase

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

Try Supermodel Free