Home / Function/ StringBuilder() — netty Function Reference

StringBuilder() — netty Function Reference

Architecture documentation for the StringBuilder() function in NetUtil.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  800bd642_4522_e7a3_9f7b_c3ae24277d53["StringBuilder()"]
  40fb3f7d_c2dd_316b_f965_bdef8e0dad94["NetUtil"]
  800bd642_4522_e7a3_9f7b_c3ae24277d53 -->|defined in| 40fb3f7d_c2dd_316b_f965_bdef8e0dad94
  76ca794c_42a7_ae42_5748_a0485c14cd5a["String()"]
  76ca794c_42a7_ae42_5748_a0485c14cd5a -->|calls| 800bd642_4522_e7a3_9f7b_c3ae24277d53
  style 800bd642_4522_e7a3_9f7b_c3ae24277d53 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/NetUtil.java lines 923–935

    private static StringBuilder newSocketAddressStringBuilder(String host, String port, boolean ipv4) {
        int hostLen = host.length();
        if (ipv4) {
            // Need to include enough space for hostString:port.
            return new StringBuilder(hostLen + 1 + port.length()).append(host);
        }
        // Need to include enough space for [hostString]:port.
        StringBuilder stringBuilder = new StringBuilder(hostLen + 3 + port.length());
        if (hostLen > 1 && host.charAt(0) == '[' && host.charAt(hostLen - 1) == ']') {
            return stringBuilder.append(host);
        }
        return stringBuilder.append('[').append(host).append(']');
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does StringBuilder() do?
StringBuilder() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/NetUtil.java.
Where is StringBuilder() defined?
StringBuilder() is defined in common/src/main/java/io/netty/util/NetUtil.java at line 923.
What calls StringBuilder()?
StringBuilder() is called by 1 function(s): String.

Analyze Your Own Codebase

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

Try Supermodel Free