Home / Function/ encodeUtf8ComponentSlow() — netty Function Reference

encodeUtf8ComponentSlow() — netty Function Reference

Architecture documentation for the encodeUtf8ComponentSlow() function in QueryStringEncoder.java from the netty codebase.

Function java ProtocolCodecs HTTP calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  6e537793_b2eb_9896_6f4e_18ef6539826b["encodeUtf8ComponentSlow()"]
  88739b5e_ab87_c690_d57f_c07e4748985e["QueryStringEncoder"]
  6e537793_b2eb_9896_6f4e_18ef6539826b -->|defined in| 88739b5e_ab87_c690_d57f_c07e4748985e
  79616a0a_4b03_da10_392b_24c9aae16249["encodeUtf8Component()"]
  79616a0a_4b03_da10_392b_24c9aae16249 -->|calls| 6e537793_b2eb_9896_6f4e_18ef6539826b
  96c7280e_7a89_a791_3054_165b310c2092["dontNeedEncoding()"]
  6e537793_b2eb_9896_6f4e_18ef6539826b -->|calls| 96c7280e_7a89_a791_3054_165b310c2092
  1e251d8b_1f4e_c93f_e50b_1d388bdd79dd["appendEncoded()"]
  6e537793_b2eb_9896_6f4e_18ef6539826b -->|calls| 1e251d8b_1f4e_c93f_e50b_1d388bdd79dd
  292af774_f477_a78b_4c13_7c754780ae80["writeUtf8Surrogate()"]
  6e537793_b2eb_9896_6f4e_18ef6539826b -->|calls| 292af774_f477_a78b_4c13_7c754780ae80
  style 6e537793_b2eb_9896_6f4e_18ef6539826b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java lines 174–204

    private void encodeUtf8ComponentSlow(CharSequence s, int start, int len) {
        for (int i = start; i < len; i++) {
            char c = s.charAt(i);
            if (c < 0x80) {
                if (dontNeedEncoding(c)) {
                    uriBuilder.append(c);
                } else {
                    appendEncoded(c);
                }
            } else if (c < 0x800) {
                appendEncoded(0xc0 | (c >> 6));
                appendEncoded(0x80 | (c & 0x3f));
            } else if (StringUtil.isSurrogate(c)) {
                if (!Character.isHighSurrogate(c)) {
                    appendEncoded(WRITE_UTF_UNKNOWN);
                    continue;
                }
                // Surrogate Pair consumes 2 characters.
                if (++i == s.length()) {
                    appendEncoded(WRITE_UTF_UNKNOWN);
                    break;
                }
                // Extra method to allow inlining the rest of writeUtf8 which is the most likely code path.
                writeUtf8Surrogate(c, s.charAt(i));
            } else {
                appendEncoded(0xe0 | (c >> 12));
                appendEncoded(0x80 | ((c >> 6) & 0x3f));
                appendEncoded(0x80 | (c & 0x3f));
            }
        }
    }

Subdomains

Frequently Asked Questions

What does encodeUtf8ComponentSlow() do?
encodeUtf8ComponentSlow() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java.
Where is encodeUtf8ComponentSlow() defined?
encodeUtf8ComponentSlow() is defined in codec-http/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java at line 174.
What does encodeUtf8ComponentSlow() call?
encodeUtf8ComponentSlow() calls 3 function(s): appendEncoded, dontNeedEncoding, writeUtf8Surrogate.
What calls encodeUtf8ComponentSlow()?
encodeUtf8ComponentSlow() is called by 1 function(s): encodeUtf8Component.

Analyze Your Own Codebase

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

Try Supermodel Free