Home / Class/ SocksCommonUtils Class — netty Architecture

SocksCommonUtils Class — netty Architecture

Architecture documentation for the SocksCommonUtils class in SocksCommonUtils.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2b8e777a_398d_09ce_95f2_3d04c8ebedca["SocksCommonUtils"]
  b868b85e_e8b7_3e45_4268_ea2fea66d1e3["SocksCommonUtils.java"]
  2b8e777a_398d_09ce_95f2_3d04c8ebedca -->|defined in| b868b85e_e8b7_3e45_4268_ea2fea66d1e3
  de4cdfd6_5a77_47d9_3e97_f22f25f603ac["SocksCommonUtils()"]
  2b8e777a_398d_09ce_95f2_3d04c8ebedca -->|method| de4cdfd6_5a77_47d9_3e97_f22f25f603ac
  29c2ba2c_c375_1108_5a0a_9295d234ea01["String()"]
  2b8e777a_398d_09ce_95f2_3d04c8ebedca -->|method| 29c2ba2c_c375_1108_5a0a_9295d234ea01
  9d37101a_82dd_1286_7f51_d70e7e1eb33e["ipv6toStr()"]
  2b8e777a_398d_09ce_95f2_3d04c8ebedca -->|method| 9d37101a_82dd_1286_7f51_d70e7e1eb33e
  4ebf9700_fcff_cb89_bb9d_6641d79fbec1["appendHextet()"]
  2b8e777a_398d_09ce_95f2_3d04c8ebedca -->|method| 4ebf9700_fcff_cb89_bb9d_6641d79fbec1

Relationship Graph

Source Code

codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCommonUtils.java lines 20–58

final class SocksCommonUtils {
    public static final SocksRequest UNKNOWN_SOCKS_REQUEST = new UnknownSocksRequest();
    public static final SocksResponse UNKNOWN_SOCKS_RESPONSE = new UnknownSocksResponse();

    /**
     * A constructor to stop this class being constructed.
     */
    private SocksCommonUtils() {
        // NOOP
    }

    private static final char ipv6hextetSeparator = ':';

    /**
     * Converts numeric IPv6 to standard (non-compressed) format.
     */
    public static String ipv6toStr(byte[] src) {
        assert src.length == 16;
        StringBuilder sb = new StringBuilder(39);
        ipv6toStr(sb, src, 0, 8);
        return sb.toString();
    }

    private static void ipv6toStr(StringBuilder sb, byte[] src, int fromHextet, int toHextet) {
        int i;
        toHextet --;
        for (i = fromHextet; i < toHextet; i++) {
            appendHextet(sb, src, i);
            sb.append(ipv6hextetSeparator);
        }

        appendHextet(sb, src, i);
    }

    private static void appendHextet(StringBuilder sb, byte[] src, int i) {
        StringUtil.toHexString(sb, src, i << 1, 2);
    }

}

Frequently Asked Questions

What is the SocksCommonUtils class?
SocksCommonUtils is a class in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCommonUtils.java.
Where is SocksCommonUtils defined?
SocksCommonUtils is defined in codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCommonUtils.java at line 20.

Analyze Your Own Codebase

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

Try Supermodel Free