Home / Function/ testSlice() — netty Function Reference

testSlice() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/ByteBufDerivationTest.java lines 35–50

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

        assertInstanceOf(AbstractUnpooledSlicedByteBuf.class, slice);
        assertSame(buf, slice.unwrap());
        assertEquals(0, slice.readerIndex());
        assertEquals(7, slice.writerIndex());
        assertEquals(7, slice.capacity());
        assertEquals(7, slice.maxCapacity());

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

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free