Home / Function/ testDuplicate() — netty Function Reference

testDuplicate() — netty Function Reference

Architecture documentation for the testDuplicate() function in ByteBufDerivationTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  b7d08389_8828_1aca_a886_1c77062a0467["testDuplicate()"]
  fd4020ab_f8d0_a065_dc31_0331d0318aa5["ByteBufDerivationTest"]
  b7d08389_8828_1aca_a886_1c77062a0467 -->|defined in| fd4020ab_f8d0_a065_dc31_0331d0318aa5
  style b7d08389_8828_1aca_a886_1c77062a0467 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/ByteBufDerivationTest.java lines 65–80

    @Test
    public void testDuplicate() throws Exception {
        ByteBuf buf = Unpooled.buffer(8).setIndex(1, 7);
        ByteBuf dup = buf.duplicate();

        assertInstanceOf(DuplicatedByteBuf.class, dup);
        assertSame(buf, dup.unwrap());
        assertEquals(buf.readerIndex(), dup.readerIndex());
        assertEquals(buf.writerIndex(), dup.writerIndex());
        assertEquals(buf.capacity(), dup.capacity());
        assertEquals(buf.maxCapacity(), dup.maxCapacity());

        dup.setIndex(2, 6);
        assertEquals(1, buf.readerIndex());
        assertEquals(7, buf.writerIndex());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free