Home / Function/ String() — netty Function Reference

String() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  08ec021e_0e3c_00ce_ac29_756e293dcda8["String()"]
  f3549c11_8ef1_fde3_7585_cf97abbfa145["Socks4ServerDecoder"]
  08ec021e_0e3c_00ce_ac29_756e293dcda8 -->|defined in| f3549c11_8ef1_fde3_7585_cf97abbfa145
  style 08ec021e_0e3c_00ce_ac29_756e293dcda8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ServerDecoder.java lines 125–135

    private static String readString(String fieldName, ByteBuf in) {
        int length = in.bytesBefore(MAX_FIELD_LENGTH + 1, (byte) 0);
        if (length < 0) {
            throw new DecoderException("field '" + fieldName + "' longer than " + MAX_FIELD_LENGTH + " chars");
        }

        String value = in.readSlice(length).toString(CharsetUtil.US_ASCII);
        in.skipBytes(1); // Skip the NUL.

        return value;
    }

Domain

Subdomains

Frequently Asked Questions

What does String() do?
String() is a function in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ServerDecoder.java.
Where is String() defined?
String() is defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ServerDecoder.java at line 125.

Analyze Your Own Codebase

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

Try Supermodel Free