Home / Function/ nioBuffers() — netty Function Reference

nioBuffers() — netty Function Reference

Architecture documentation for the nioBuffers() function in FixedCompositeByteBuf.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  d5ccb74e_8331_ba41_6b91_072f8f658dd7["nioBuffers()"]
  c3651b69_631a_1f76_b70c_086b089609c2["FixedCompositeByteBuf"]
  d5ccb74e_8331_ba41_6b91_072f8f658dd7 -->|defined in| c3651b69_631a_1f76_b70c_086b089609c2
  a59272e8_83f1_4614_a108_aaa808356e48["getBytes()"]
  a59272e8_83f1_4614_a108_aaa808356e48 -->|calls| d5ccb74e_8331_ba41_6b91_072f8f658dd7
  12dffcc0_3a2d_188c_c00b_c517c07bea36["ByteBuffer()"]
  12dffcc0_3a2d_188c_c00b_c517c07bea36 -->|calls| d5ccb74e_8331_ba41_6b91_072f8f658dd7
  6cdaf76a_54de_8eca_a3fc_af93529f98b1["nioBufferCount()"]
  d5ccb74e_8331_ba41_6b91_072f8f658dd7 -->|calls| 6cdaf76a_54de_8eca_a3fc_af93529f98b1
  style d5ccb74e_8331_ba41_6b91_072f8f658dd7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/FixedCompositeByteBuf.java lines 562–600

    @Override
    public ByteBuffer[] nioBuffers(int index, int length) {
        checkIndex(index, length);
        if (length == 0) {
            return EmptyArrays.EMPTY_BYTE_BUFFERS;
        }

        RecyclableArrayList array = RecyclableArrayList.newInstance(buffers.length);
        try {
            Component c = findComponent(index);
            int i = c.index;
            int adjustment = c.offset;
            ByteBuf s = c.buf;
            for (;;) {
                int localLength = Math.min(length, s.readableBytes() - (index - adjustment));
                switch (s.nioBufferCount()) {
                    case 0:
                        throw new UnsupportedOperationException();
                    case 1:
                        array.add(s.nioBuffer(index - adjustment, localLength));
                        break;
                    default:
                        Collections.addAll(array, s.nioBuffers(index - adjustment, localLength));
                }

                index += localLength;
                length -= localLength;
                adjustment += s.readableBytes();
                if (length <= 0) {
                    break;
                }
                s = buffer(++i);
            }

            return array.toArray(EmptyArrays.EMPTY_BYTE_BUFFERS);
        } finally {
            array.recycle();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does nioBuffers() do?
nioBuffers() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/FixedCompositeByteBuf.java.
Where is nioBuffers() defined?
nioBuffers() is defined in buffer/src/main/java/io/netty/buffer/FixedCompositeByteBuf.java at line 562.
What does nioBuffers() call?
nioBuffers() calls 1 function(s): nioBufferCount.
What calls nioBuffers()?
nioBuffers() is called by 2 function(s): ByteBuffer, getBytes.

Analyze Your Own Codebase

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

Try Supermodel Free