Home / Function/ addComponent0() — netty Function Reference

addComponent0() — netty Function Reference

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

Function java Buffer Telemetry calls 8 called by 2

Entity Profile

Dependency Diagram

graph TD
  59aa513a_9196_9707_e719_00f253da08eb["addComponent0()"]
  6b8e4d93_5aed_4ff7_ccdd_9c021b0fe7d6["CompositeByteBuf"]
  59aa513a_9196_9707_e719_00f253da08eb -->|defined in| 6b8e4d93_5aed_4ff7_ccdd_9c021b0fe7d6
  e9920c4e_d91d_be1d_34e0_9c0ddc060f5d["CompositeByteBuf()"]
  e9920c4e_d91d_be1d_34e0_9c0ddc060f5d -->|calls| 59aa513a_9196_9707_e719_00f253da08eb
  52131157_ab49_bbc0_4b2f_f75786fd3e51["addComponents0()"]
  52131157_ab49_bbc0_4b2f_f75786fd3e51 -->|calls| 59aa513a_9196_9707_e719_00f253da08eb
  fa74dd51_3f34_2d56_ed8e_41955da7b338["checkComponentIndex()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| fa74dd51_3f34_2d56_ed8e_41955da7b338
  79a833c5_92f9_7a41_19fc_646ea49cfaa3["length()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| 79a833c5_92f9_7a41_19fc_646ea49cfaa3
  59bfffdc_1653_76b9_674e_0f9e0a0ace57["checkForOverflow()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| 59bfffdc_1653_76b9_674e_0f9e0a0ace57
  8b40bcf2_a1f9_fa88_113f_04b3bb1e18c3["capacity()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| 8b40bcf2_a1f9_fa88_113f_04b3bb1e18c3
  8421b4cd_91c2_2528_5e16_aaa6ada1145b["addComp()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| 8421b4cd_91c2_2528_5e16_aaa6ada1145b
  4eda92aa_c086_a58e_2291_b7e84f09b571["updateComponentOffsets()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| 4eda92aa_c086_a58e_2291_b7e84f09b571
  b9fb9df6_b0c5_dd85_0821_2d55314931d2["reposition()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| b9fb9df6_b0c5_dd85_0821_2d55314931d2
  e0d5f17d_e6ec_c510_8c93_affd6e86bd6d["release()"]
  59aa513a_9196_9707_e719_00f253da08eb -->|calls| e0d5f17d_e6ec_c510_8c93_affd6e86bd6d
  style 59aa513a_9196_9707_e719_00f253da08eb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java lines 280–310

    private int addComponent0(boolean increaseWriterIndex, int cIndex, ByteBuf buffer) {
        assert buffer != null;
        boolean wasAdded = false;
        try {
            checkComponentIndex(cIndex);

            // No need to consolidate - just add a component to the list.
            Component c = newComponent(ensureAccessible(buffer), 0);
            int readableBytes = c.length();

            // Check if we would overflow.
            // See https://github.com/netty/netty/issues/10194
            checkForOverflow(capacity(), readableBytes);

            addComp(cIndex, c);
            wasAdded = true;
            if (readableBytes > 0 && cIndex < componentCount - 1) {
                updateComponentOffsets(cIndex);
            } else if (cIndex > 0) {
                c.reposition(components[cIndex - 1].endOffset);
            }
            if (increaseWriterIndex) {
                writerIndex += readableBytes;
            }
            return cIndex;
        } finally {
            if (!wasAdded) {
                buffer.release();
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does addComponent0() do?
addComponent0() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java.
Where is addComponent0() defined?
addComponent0() is defined in buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java at line 280.
What does addComponent0() call?
addComponent0() calls 8 function(s): addComp, capacity, checkComponentIndex, checkForOverflow, length, release, reposition, updateComponentOffsets.
What calls addComponent0()?
addComponent0() is called by 2 function(s): CompositeByteBuf, addComponents0.

Analyze Your Own Codebase

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

Try Supermodel Free