Home / Function/ testReadOnlyOfDuplicate() — netty Function Reference

testReadOnlyOfDuplicate() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/ByteBufDerivationTest.java lines 128–140

    @Test
    public void testReadOnlyOfDuplicate() throws Exception {
        ByteBuf buf = Unpooled.buffer(8).setIndex(1, 7);
        ByteBuf dup = buf.duplicate().setIndex(2, 6);
        ByteBuf ro = Unpooled.unmodifiableBuffer(dup);

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

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free