Home / Function/ testToComponentIndex() — netty Function Reference

testToComponentIndex() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java lines 163–183

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

        // spot checks
        assertEquals(0, buf.toComponentIndex(4));
        assertEquals(1, buf.toComponentIndex(5));
        assertEquals(2, buf.toComponentIndex(15));

        //Loop through each byte

        byte index = 0;

        while (index < buf.capacity()) {
            int cindex = buf.toComponentIndex(index++);
            assertTrue(cindex >= 0 && cindex < buf.numComponents());
        }

        buf.release();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free