Home / Function/ testNioBufferExposeOnlyRegion() — netty Function Reference

testNioBufferExposeOnlyRegion() — netty Function Reference

Architecture documentation for the testNioBufferExposeOnlyRegion() function in AbstractByteBufTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  cb24de82_2f0b_a8c5_9d95_8b767234495a["testNioBufferExposeOnlyRegion()"]
  6540f2d1_cdad_6705_dd1d_9a24e2e53242["AbstractByteBufTest"]
  cb24de82_2f0b_a8c5_9d95_8b767234495a -->|defined in| 6540f2d1_cdad_6705_dd1d_9a24e2e53242
  style cb24de82_2f0b_a8c5_9d95_8b767234495a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/test/java/io/netty/buffer/AbstractByteBufTest.java lines 3030–3046

    @Test
    @SuppressWarnings("ForLoopThatDoesntUseLoopVariable")
    public void testNioBufferExposeOnlyRegion() {
        final ByteBuf buffer = newBuffer(8);
        byte[] data = new byte[8];
        random.nextBytes(data);
        buffer.writeBytes(data);

        ByteBuffer nioBuf = buffer.nioBuffer(1, data.length - 2);
        assertEquals(0, nioBuf.position());
        assertEquals(6, nioBuf.remaining());

        for (int i = 1; nioBuf.hasRemaining(); i++) {
            assertEquals(data[i], nioBuf.get());
        }
        buffer.release();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free