Home / Function/ String() — netty Function Reference

String() — netty Function Reference

Architecture documentation for the String() function in AbstractHttpData.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1553a0ee_a84a_7273_3ccc_36d13c16215a["String()"]
  14418a44_5c0f_1bba_1821_88b876152db3["AbstractHttpData"]
  1553a0ee_a84a_7273_3ccc_36d13c16215a -->|defined in| 14418a44_5c0f_1bba_1821_88b876152db3
  947a8194_72bf_7663_342e_e237708df362["length()"]
  1553a0ee_a84a_7273_3ccc_36d13c16215a -->|calls| 947a8194_72bf_7663_342e_e237708df362
  style 1553a0ee_a84a_7273_3ccc_36d13c16215a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractHttpData.java lines 53–95

    private static String cleanName(String name) {
        int len = name.length();
        StringBuilder sb = null;

        int start = 0;
        int end = len;

        // Trim leading whitespace
        while (start < end && Character.isWhitespace(name.charAt(start))) {
            start++;
        }

        // Trim trailing whitespace
        while (end > start && Character.isWhitespace(name.charAt(end - 1))) {
            end--;
        }

        for (int i = start; i < end; i++) {
            char c = name.charAt(i);

            if (c == '\n') {
                // Skip newline entirely
                if (sb == null) {
                    sb = new StringBuilder(len);
                    sb.append(name, start, i);
                }
                continue;
            }

            if (c == '\r' || c == '\t') {
                if (sb == null) {
                    sb = new StringBuilder(len);
                    sb.append(name, start, i);
                }
                sb.append(' ');
            } else if (sb != null) {
                sb.append(c);
            }
        }

        // If no replacements were needed, return the trimmed slice
        return sb == null ? name.substring(start, end) : sb.toString();
    }

Subdomains

Calls

Frequently Asked Questions

What does String() do?
String() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractHttpData.java.
Where is String() defined?
String() is defined in codec-http/src/main/java/io/netty/handler/codec/http/multipart/AbstractHttpData.java at line 53.
What does String() call?
String() calls 1 function(s): length.

Analyze Your Own Codebase

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

Try Supermodel Free