Home / Function/ setCharSequence0() — netty Function Reference

setCharSequence0() — netty Function Reference

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

Function java Buffer Telemetry calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  09330b09_48e7_0b2a_77f1_8be816eb5ff4["setCharSequence0()"]
  e9381b1a_dc06_843c_be7e_5e0eddee4a3a["AdaptiveByteBuf"]
  09330b09_48e7_0b2a_77f1_8be816eb5ff4 -->|defined in| e9381b1a_dc06_843c_be7e_5e0eddee4a3a
  2ecf6bf5_f9c4_3493_e2e9_475724fb7155["setCharSequence()"]
  2ecf6bf5_f9c4_3493_e2e9_475724fb7155 -->|calls| 09330b09_48e7_0b2a_77f1_8be816eb5ff4
  6dcf2252_7b67_b7cd_0522_28e1f72c0f9a["writeCharSequence()"]
  6dcf2252_7b67_b7cd_0522_28e1f72c0f9a -->|calls| 09330b09_48e7_0b2a_77f1_8be816eb5ff4
  57c1d4e8_2f83_03da_aa55_345ed2144af3["getBytes()"]
  09330b09_48e7_0b2a_77f1_8be816eb5ff4 -->|calls| 57c1d4e8_2f83_03da_aa55_345ed2144af3
  c4507935_a46f_63d6_724d_0b79ac9627bd["setBytes()"]
  09330b09_48e7_0b2a_77f1_8be816eb5ff4 -->|calls| c4507935_a46f_63d6_724d_0b79ac9627bd
  style 09330b09_48e7_0b2a_77f1_8be816eb5ff4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java lines 1956–1984

        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/AdaptivePoolingAllocator.java.
Where is setCharSequence0() defined?
setCharSequence0() is defined in buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java at line 1956.
What does setCharSequence0() call?
setCharSequence0() calls 2 function(s): getBytes, setBytes.
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