Home / Function/ forEachByteDesc0() — netty Function Reference

forEachByteDesc0() — netty Function Reference

Architecture documentation for the forEachByteDesc0() function in CompositeByteBuf.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  feafa28f_9555_7306_d9ec_7f16713f1981["forEachByteDesc0()"]
  6b8e4d93_5aed_4ff7_ccdd_9c021b0fe7d6["CompositeByteBuf"]
  feafa28f_9555_7306_d9ec_7f16713f1981 -->|defined in| 6b8e4d93_5aed_4ff7_ccdd_9c021b0fe7d6
  56df3e62_e22d_e17d_1a00_60ba703c8e92["toComponentIndex0()"]
  feafa28f_9555_7306_d9ec_7f16713f1981 -->|calls| 56df3e62_e22d_e17d_1a00_60ba703c8e92
  d3be0b0f_c8ba_dc16_970f_8a5302e005af["idx()"]
  feafa28f_9555_7306_d9ec_7f16713f1981 -->|calls| d3be0b0f_c8ba_dc16_970f_8a5302e005af
  style feafa28f_9555_7306_d9ec_7f16713f1981 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java lines 693–717

    @Override
    protected int forEachByteDesc0(int rStart, int rEnd, ByteProcessor processor) throws Exception {
        if (rEnd > rStart) { // rStart *and* rEnd are inclusive
            return -1;
        }
        for (int i = toComponentIndex0(rStart), length = 1 + rStart - rEnd; length > 0; i--) {
            Component c = components[i];
            if (c.offset == c.endOffset) {
                continue; // empty
            }
            ByteBuf s = c.buf;
            int localRStart = c.idx(length + rEnd);
            int localLength = Math.min(length, localRStart), localIndex = localRStart - localLength;
            // avoid additional checks in AbstractByteBuf case
            int result = s instanceof AbstractByteBuf
                ? ((AbstractByteBuf) s).forEachByteDesc0(localRStart - 1, localIndex, processor)
                : s.forEachByteDesc(localIndex, localLength, processor);

            if (result != -1) {
                return result - c.adjustment;
            }
            length -= localLength;
        }
        return -1;
    }

Domain

Subdomains

Frequently Asked Questions

What does forEachByteDesc0() do?
forEachByteDesc0() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java.
Where is forEachByteDesc0() defined?
forEachByteDesc0() is defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java at line 693.
What does forEachByteDesc0() call?
forEachByteDesc0() calls 2 function(s): idx, toComponentIndex0.

Analyze Your Own Codebase

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

Try Supermodel Free