Home / Function/ setBytes() — netty Function Reference

setBytes() — netty Function Reference

Architecture documentation for the setBytes() function in UnsafeByteBufUtil.java from the netty codebase.

Function java Buffer Telemetry calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  5b846bad_881f_b151_e229_064f0602dae4["setBytes()"]
  2f99d7c3_a5a0_5538_ae7e_a825ef1ab37a["UnsafeByteBufUtil"]
  5b846bad_881f_b151_e229_064f0602dae4 -->|defined in| 2f99d7c3_a5a0_5538_ae7e_a825ef1ab37a
  0befdf4d_4fcc_2412_03b6_714a74e49d11["getBytes()"]
  0befdf4d_4fcc_2412_03b6_714a74e49d11 -->|calls| 5b846bad_881f_b151_e229_064f0602dae4
  0befdf4d_4fcc_2412_03b6_714a74e49d11["getBytes()"]
  5b846bad_881f_b151_e229_064f0602dae4 -->|calls| 0befdf4d_4fcc_2412_03b6_714a74e49d11
  9590a4f8_5d7a_5842_8781_93e563dc4044["setSingleBytes()"]
  5b846bad_881f_b151_e229_064f0602dae4 -->|calls| 9590a4f8_5d7a_5842_8781_93e563dc4044
  style 5b846bad_881f_b151_e229_064f0602dae4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/UnsafeByteBufUtil.java lines 466–480

    static int setBytes(AbstractByteBuf buf, long addr, int index, InputStream in, int length) throws IOException {
        buf.checkIndex(index, length);
        ByteBuf tmpBuf = buf.alloc().heapBuffer(length);
        try {
            byte[] tmp = tmpBuf.array();
            int offset = tmpBuf.arrayOffset();
            int readBytes = in.read(tmp, offset, length);
            if (readBytes > 0) {
                PlatformDependent.copyMemory(tmp, offset, addr, readBytes);
            }
            return readBytes;
        } finally {
            tmpBuf.release();
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does setBytes() do?
setBytes() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/UnsafeByteBufUtil.java.
Where is setBytes() defined?
setBytes() is defined in buffer/src/main/java/io/netty/buffer/UnsafeByteBufUtil.java at line 466.
What does setBytes() call?
setBytes() calls 2 function(s): getBytes, setSingleBytes.
What calls setBytes()?
setBytes() is called by 1 function(s): getBytes.

Analyze Your Own Codebase

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

Try Supermodel Free