Home / Function/ ByteBuffer() — netty Function Reference

ByteBuffer() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/FixedCompositeByteBuf.java lines 533–552

    @Override
    public ByteBuffer nioBuffer(int index, int length) {
        checkIndex(index, length);
        if (buffers.length == 1) {
            ByteBuf buf = buffer(0);
            if (buf.nioBufferCount() == 1) {
                return buf.nioBuffer(index, length);
            }
        }
        ByteBuffer merged = ByteBuffer.allocate(length).order(order());
        ByteBuffer[] buffers = nioBuffers(index, length);

        //noinspection ForLoopReplaceableByForEach
        for (int i = 0; i < buffers.length; i++) {
            merged.put(buffers[i]);
        }

        merged.flip();
        return merged;
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free