Home / Function/ testReadOnly() — netty Function Reference

testReadOnly() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/ByteBufDerivationTest.java lines 97–111

    @Test
    public void testReadOnly() throws Exception {
        ByteBuf buf = Unpooled.buffer(8).setIndex(1, 7);
        ByteBuf ro = Unpooled.unmodifiableBuffer(buf);

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

        ro.setIndex(2, 6);
        assertEquals(1, buf.readerIndex());
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free