Home / Function/ testDecompose() — netty Function Reference

testDecompose() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7af0cd7d_fa2b_76e4_0419_042f170fb4cb["testDecompose()"]
  47bc0a20_e243_89ff_132b_99ac6b23835f["AbstractCompositeByteBufTest"]
  7af0cd7d_fa2b_76e4_0419_042f170fb4cb -->|defined in| 47bc0a20_e243_89ff_132b_99ac6b23835f
  ff34390e_33da_5500_4742_bc588734de7c["testDecomposeMultiple()"]
  ff34390e_33da_5500_4742_bc588734de7c -->|calls| 7af0cd7d_fa2b_76e4_0419_042f170fb4cb
  e11d06bf_5b56_98e6_0ec3_f60f59460d62["testDecomposeOne()"]
  e11d06bf_5b56_98e6_0ec3_f60f59460d62 -->|calls| 7af0cd7d_fa2b_76e4_0419_042f170fb4cb
  3bebb657_3f24_53f1_240c_2f3ad0bcb9d3["testDecomposeNone()"]
  3bebb657_3f24_53f1_240c_2f3ad0bcb9d3 -->|calls| 7af0cd7d_fa2b_76e4_0419_042f170fb4cb
  style 7af0cd7d_fa2b_76e4_0419_042f170fb4cb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java lines 1457–1480

    private void testDecompose(int offset, int length, int expectedListSize) {
        byte[] bytes = new byte[1024];
        ThreadLocalRandom.current().nextBytes(bytes);
        ByteBuf buf = wrappedBuffer(bytes);

        CompositeByteBuf composite = newCompositeBuffer();
        composite.addComponents(true,
                                buf.retainedSlice(100, 200),
                                buf.retainedSlice(300, 400),
                                buf.retainedSlice(700, 100));

        ByteBuf slice = composite.slice(offset, length);
        List<ByteBuf> bufferList = composite.decompose(offset, length);
        assertEquals(expectedListSize, bufferList.size());
        ByteBuf wrapped = wrappedBuffer(bufferList.toArray(new ByteBuf[0]));

        assertEquals(slice, wrapped);
        composite.release();
        buf.release();

        for (ByteBuf buffer: bufferList) {
            assertEquals(0, buffer.refCnt());
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testDecompose() do?
testDecompose() is a function in the netty codebase, defined in buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java.
Where is testDecompose() defined?
testDecompose() is defined in buffer/src/test/java/io/netty/buffer/AbstractCompositeByteBufTest.java at line 1457.
What calls testDecompose()?
testDecompose() is called by 3 function(s): testDecomposeMultiple, testDecomposeNone, testDecomposeOne.

Analyze Your Own Codebase

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

Try Supermodel Free