Home / Function/ forEachByteAsc0() — netty Function Reference

forEachByteAsc0() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java lines 667–691

    @Override
    protected int forEachByteAsc0(int start, int end, ByteProcessor processor) throws Exception {
        if (end <= start) {
            return -1;
        }
        for (int i = toComponentIndex0(start), length = end - start; length > 0; i++) {
            Component c = components[i];
            if (c.offset == c.endOffset) {
                continue; // empty
            }
            ByteBuf s = c.buf;
            int localStart = c.idx(start);
            int localLength = Math.min(length, c.endOffset - start);
            // avoid additional checks in AbstractByteBuf case
            int result = s instanceof AbstractByteBuf
                ? ((AbstractByteBuf) s).forEachByteAsc0(localStart, localStart + localLength, processor)
                : s.forEachByte(localStart, localLength, processor);
            if (result != -1) {
                return result - c.adjustment;
            }
            start += localLength;
            length -= localLength;
        }
        return -1;
    }

Domain

Subdomains

Frequently Asked Questions

What does forEachByteAsc0() do?
forEachByteAsc0() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java.
Where is forEachByteAsc0() defined?
forEachByteAsc0() is defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java at line 667.
What does forEachByteAsc0() call?
forEachByteAsc0() 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