Home / Function/ testNioBuffersExpand() — netty Function Reference

testNioBuffersExpand() — netty Function Reference

Architecture documentation for the testNioBuffersExpand() function in ChannelOutboundBufferTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5e4cd308_0493_7e2c_3914_7cde3fa79eb3["testNioBuffersExpand()"]
  06eb8f18_da0c_40bf_fb14_47e2c94a6923["ChannelOutboundBufferTest"]
  5e4cd308_0493_7e2c_3914_7cde3fa79eb3 -->|defined in| 06eb8f18_da0c_40bf_fb14_47e2c94a6923
  31b49bd0_4c82_f6fd_3697_c6d8205d4cfe["TestChannel()"]
  5e4cd308_0493_7e2c_3914_7cde3fa79eb3 -->|calls| 31b49bd0_4c82_f6fd_3697_c6d8205d4cfe
  4bdec6f8_3c15_b5ee_d1a3_716048f52c5a["release()"]
  5e4cd308_0493_7e2c_3914_7cde3fa79eb3 -->|calls| 4bdec6f8_3c15_b5ee_d1a3_716048f52c5a
  style 5e4cd308_0493_7e2c_3914_7cde3fa79eb3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java lines 119–138

    @Test
    public void testNioBuffersExpand() {
        TestChannel channel = new TestChannel();

        ChannelOutboundBuffer buffer = new ChannelOutboundBuffer(channel);

        ByteBuf buf = directBuffer().writeBytes("buf1".getBytes(CharsetUtil.US_ASCII));
        for (int i = 0; i < 64; i++) {
            buffer.addMessage(buf.copy(), buf.readableBytes(), channel.voidPromise());
        }
        assertEquals(0, buffer.nioBufferCount(), "Should still be 0 as not flushed yet");
        buffer.addFlush();
        ByteBuffer[] buffers = buffer.nioBuffers();
        assertEquals(64, buffer.nioBufferCount());
        for (int i = 0;  i < buffer.nioBufferCount(); i++) {
            assertEquals(buffers[i], buf.internalNioBuffer(buf.readerIndex(), buf.readableBytes()));
        }
        release(buffer);
        buf.release();
    }

Domain

Subdomains

Frequently Asked Questions

What does testNioBuffersExpand() do?
testNioBuffersExpand() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java.
Where is testNioBuffersExpand() defined?
testNioBuffersExpand() is defined in transport/src/test/java/io/netty/channel/ChannelOutboundBufferTest.java at line 119.
What does testNioBuffersExpand() call?
testNioBuffersExpand() calls 2 function(s): TestChannel, release.

Analyze Your Own Codebase

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

Try Supermodel Free