Home / Function/ consolidate0() — netty Function Reference

consolidate0() — netty Function Reference

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

Function java Buffer Telemetry calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe["consolidate0()"]
  6b8e4d93_5aed_4ff7_ccdd_9c021b0fe7d6["CompositeByteBuf"]
  e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe -->|defined in| 6b8e4d93_5aed_4ff7_ccdd_9c021b0fe7d6
  aeb2b672_c94f_1ad1_8629_38701e5bcdc7["consolidateIfNeeded()"]
  aeb2b672_c94f_1ad1_8629_38701e5bcdc7 -->|calls| e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe
  e9920c4e_d91d_be1d_34e0_9c0ddc060f5d["CompositeByteBuf()"]
  e9920c4e_d91d_be1d_34e0_9c0ddc060f5d -->|calls| e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe
  a7db8e64_9b44_a58d_6b49_ce488761369b["transferTo()"]
  e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe -->|calls| a7db8e64_9b44_a58d_6b49_ce488761369b
  d5b898be_7811_39bd_fcb7_dd60b8ce6ac7["removeCompRange()"]
  e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe -->|calls| d5b898be_7811_39bd_fcb7_dd60b8ce6ac7
  4eda92aa_c086_a58e_2291_b7e84f09b571["updateComponentOffsets()"]
  e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe -->|calls| 4eda92aa_c086_a58e_2291_b7e84f09b571
  style e3a7e7ac_07b6_598f_1d6b_b0f8a41bbafe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java lines 1774–1793

    private void consolidate0(int cIndex, int numComponents) {
        if (numComponents <= 1) {
            return;
        }

        final int endCIndex = cIndex + numComponents;
        final int startOffset = cIndex != 0 ? components[cIndex].offset : 0;
        final int capacity = components[endCIndex - 1].endOffset - startOffset;
        final ByteBuf consolidated = allocBuffer(capacity);

        for (int i = cIndex; i < endCIndex; i ++) {
            components[i].transferTo(consolidated);
        }
        lastAccessed = null;
        removeCompRange(cIndex + 1, endCIndex);
        components[cIndex] = newComponent(consolidated, 0);
        if (cIndex != 0 || numComponents != componentCount) {
            updateComponentOffsets(cIndex);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does consolidate0() do?
consolidate0() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java.
Where is consolidate0() defined?
consolidate0() is defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java at line 1774.
What does consolidate0() call?
consolidate0() calls 3 function(s): removeCompRange, transferTo, updateComponentOffsets.
What calls consolidate0()?
consolidate0() is called by 2 function(s): CompositeByteBuf, consolidateIfNeeded.

Analyze Your Own Codebase

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

Try Supermodel Free