Home / Function/ ByteBuf() — netty Function Reference

ByteBuf() — netty Function Reference

Architecture documentation for the ByteBuf() function in ReadOnlyUnsafeDirectByteBuf.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  58ba99ab_9497_d8f7_86b0_4309374c437b["ByteBuf()"]
  4dca7c75_8491_c7dd_3eca_c6f1bd3bb01b["ReadOnlyUnsafeDirectByteBuf"]
  58ba99ab_9497_d8f7_86b0_4309374c437b -->|defined in| 4dca7c75_8491_c7dd_3eca_c6f1bd3bb01b
  ded47edf_9d24_1040_3147_2551a9b24b19["hasMemoryAddress()"]
  58ba99ab_9497_d8f7_86b0_4309374c437b -->|calls| ded47edf_9d24_1040_3147_2551a9b24b19
  92e6c372_18f9_2f9a_f225_01b9d3b8971c["addr()"]
  58ba99ab_9497_d8f7_86b0_4309374c437b -->|calls| 92e6c372_18f9_2f9a_f225_01b9d3b8971c
  f7f89df3_0b9f_b4a3_f6e5_d9950327763b["memoryAddress()"]
  58ba99ab_9497_d8f7_86b0_4309374c437b -->|calls| f7f89df3_0b9f_b4a3_f6e5_d9950327763b
  style 58ba99ab_9497_d8f7_86b0_4309374c437b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/ReadOnlyUnsafeDirectByteBuf.java lines 63–79

    @Override
    protected ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length, boolean internal) {
        checkIndex(index, length);
        ObjectUtil.checkNotNull(dst, "dst");
        if (dstIndex < 0 || dstIndex > dst.capacity() - length) {
            throw new IndexOutOfBoundsException("dstIndex: " + dstIndex);
        }

        if (dst.hasMemoryAddress()) {
            PlatformDependent.copyMemory(addr(index), dst.memoryAddress() + dstIndex, length);
        } else if (dst.hasArray()) {
            PlatformDependent.copyMemory(addr(index), dst.array(), dst.arrayOffset() + dstIndex, length);
        } else {
            dst.setBytes(dstIndex, this, index, length);
        }
        return this;
    }

Domain

Subdomains

Frequently Asked Questions

What does ByteBuf() do?
ByteBuf() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/ReadOnlyUnsafeDirectByteBuf.java.
Where is ByteBuf() defined?
ByteBuf() is defined in buffer/src/main/java/io/netty/buffer/ReadOnlyUnsafeDirectByteBuf.java at line 63.
What does ByteBuf() call?
ByteBuf() calls 3 function(s): addr, hasMemoryAddress, memoryAddress.

Analyze Your Own Codebase

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

Try Supermodel Free