Home / Function/ setCharSequence0() — netty Function Reference

setCharSequence0() — netty Function Reference

Architecture documentation for the setCharSequence0() function in AbstractByteBuf.java from the netty codebase.

Function java Buffer Telemetry calls 4 called by 2

Entity Profile

Dependency Diagram

graph TD
  0afa27e0_95ae_86b1_18d2_87db939fb93c["setCharSequence0()"]
  bbab270f_457a_3319_83a8_0a0540484666["AbstractByteBuf"]
  0afa27e0_95ae_86b1_18d2_87db939fb93c -->|defined in| bbab270f_457a_3319_83a8_0a0540484666
  470e1e0b_ceda_b8c6_5d71_b93538001f19["setCharSequence()"]
  470e1e0b_ceda_b8c6_5d71_b93538001f19 -->|calls| 0afa27e0_95ae_86b1_18d2_87db939fb93c
  99897980_a26e_357a_16a6_75c830f5cfe3["writeCharSequence()"]
  99897980_a26e_357a_16a6_75c830f5cfe3 -->|calls| 0afa27e0_95ae_86b1_18d2_87db939fb93c
  65072a49_d808_f162_cd6e_b26ec99d57ae["equals()"]
  0afa27e0_95ae_86b1_18d2_87db939fb93c -->|calls| 65072a49_d808_f162_cd6e_b26ec99d57ae
  287b7ae4_08b2_7835_1a21_05b041594575["ensureWritable0()"]
  0afa27e0_95ae_86b1_18d2_87db939fb93c -->|calls| 287b7ae4_08b2_7835_1a21_05b041594575
  c72c9b8b_5754_3820_9aff_a25d6d05c446["checkIndex0()"]
  0afa27e0_95ae_86b1_18d2_87db939fb93c -->|calls| c72c9b8b_5754_3820_9aff_a25d6d05c446
  bc9f46f3_e305_58ca_4e9e_9b8ccbb764fc["checkIndex()"]
  0afa27e0_95ae_86b1_18d2_87db939fb93c -->|calls| bc9f46f3_e305_58ca_4e9e_9b8ccbb764fc
  style 0afa27e0_95ae_86b1_18d2_87db939fb93c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java lines 705–733

    private int setCharSequence0(int index, CharSequence sequence, Charset charset, boolean expand) {
        if (charset.equals(CharsetUtil.UTF_8)) {
            int length = ByteBufUtil.utf8MaxBytes(sequence);
            if (expand) {
                ensureWritable0(length);
                checkIndex0(index, length);
            } else {
                checkIndex(index, length);
            }
            return ByteBufUtil.writeUtf8(this, index, length, sequence, sequence.length());
        }
        if (charset.equals(CharsetUtil.US_ASCII) || charset.equals(CharsetUtil.ISO_8859_1)) {
            int length = sequence.length();
            if (expand) {
                ensureWritable0(length);
                checkIndex0(index, length);
            } else {
                checkIndex(index, length);
            }
            return ByteBufUtil.writeAscii(this, index, sequence, length);
        }
        byte[] bytes = sequence.toString().getBytes(charset);
        if (expand) {
            ensureWritable0(bytes.length);
            // setBytes(...) will take care of checking the indices.
        }
        setBytes(index, bytes);
        return bytes.length;
    }

Domain

Subdomains

Frequently Asked Questions

What does setCharSequence0() do?
setCharSequence0() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java.
Where is setCharSequence0() defined?
setCharSequence0() is defined in buffer/src/main/java/io/netty/buffer/AbstractByteBuf.java at line 705.
What does setCharSequence0() call?
setCharSequence0() calls 4 function(s): checkIndex, checkIndex0, ensureWritable0, equals.
What calls setCharSequence0()?
setCharSequence0() is called by 2 function(s): setCharSequence, writeCharSequence.

Analyze Your Own Codebase

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

Try Supermodel Free