Home / Function/ expandNioBufferArray() — netty Function Reference

expandNioBufferArray() — netty Function Reference

Architecture documentation for the expandNioBufferArray() function in ChannelOutboundBuffer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9e868da0_9fe0_ceec_2116_5b1c65a42068["expandNioBufferArray()"]
  509b1bc5_7cdc_9ee4_03d9_31eb2203d807["ChannelOutboundBuffer"]
  9e868da0_9fe0_ceec_2116_5b1c65a42068 -->|defined in| 509b1bc5_7cdc_9ee4_03d9_31eb2203d807
  252effda_643d_d5a8_75c2_4db2e7edc340["nioBuffers()"]
  252effda_643d_d5a8_75c2_4db2e7edc340 -->|calls| 9e868da0_9fe0_ceec_2116_5b1c65a42068
  style 9e868da0_9fe0_ceec_2116_5b1c65a42068 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java lines 517–534

    private static ByteBuffer[] expandNioBufferArray(ByteBuffer[] array, int neededSpace, int size) {
        int newCapacity = array.length;
        do {
            // double capacity until it is big enough
            // See https://github.com/netty/netty/issues/1890
            newCapacity <<= 1;

            if (newCapacity < 0) {
                throw new IllegalStateException();
            }

        } while (neededSpace > newCapacity);

        ByteBuffer[] newArray = new ByteBuffer[newCapacity];
        System.arraycopy(array, 0, newArray, 0, size);

        return newArray;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does expandNioBufferArray() do?
expandNioBufferArray() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java.
Where is expandNioBufferArray() defined?
expandNioBufferArray() is defined in transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java at line 517.
What calls expandNioBufferArray()?
expandNioBufferArray() is called by 1 function(s): nioBuffers.

Analyze Your Own Codebase

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

Try Supermodel Free