Home / Class/ Socks5CommonTestUtils Class — netty Architecture

Socks5CommonTestUtils Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  d8c00960_1370_e312_da2d_7b283f26ed6d["Socks5CommonTestUtils"]
  d96c9473_13f6_43a1_3d74_189a12dfb8e1["Socks5CommonTestUtils.java"]
  d8c00960_1370_e312_da2d_7b283f26ed6d -->|defined in| d96c9473_13f6_43a1_3d74_189a12dfb8e1
  7d93f425_ddb4_be82_cd67_1dc464439677["Socks5CommonTestUtils()"]
  d8c00960_1370_e312_da2d_7b283f26ed6d -->|method| 7d93f425_ddb4_be82_cd67_1dc464439677
  626a8102_bc12_37fc_842f_64839a1d894e["writeFromClientToServer()"]
  d8c00960_1370_e312_da2d_7b283f26ed6d -->|method| 626a8102_bc12_37fc_842f_64839a1d894e
  b5b01531_c37f_d1bc_0bb0_cf416992e141["writeFromServerToClient()"]
  d8c00960_1370_e312_da2d_7b283f26ed6d -->|method| b5b01531_c37f_d1bc_0bb0_cf416992e141
  37bd6c9f_6c4d_ab56_7214_1fe88f74fa6f["ByteBuf()"]
  d8c00960_1370_e312_da2d_7b283f26ed6d -->|method| 37bd6c9f_6c4d_ab56_7214_1fe88f74fa6f

Relationship Graph

Source Code

codec-socks/src/test/java/io/netty/handler/codec/socksx/v5/Socks5CommonTestUtils.java lines 21–56

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

    public static void writeFromClientToServer(EmbeddedChannel embedder, Socks5Message msg) {
        embedder.writeInbound(encodeClient(msg));
    }

    public static void writeFromServerToClient(EmbeddedChannel embedder, Socks5Message msg) {
        embedder.writeInbound(encodeServer(msg));
    }

    public static ByteBuf encodeClient(Socks5Message msg) {
        EmbeddedChannel out = new EmbeddedChannel(Socks5ClientEncoder.DEFAULT);
        out.writeOutbound(msg);

        ByteBuf encoded = out.readOutbound();
        out.finish();

        return encoded;
    }

    public static ByteBuf encodeServer(Socks5Message msg) {
        EmbeddedChannel out = new EmbeddedChannel(Socks5ServerEncoder.DEFAULT);
        out.writeOutbound(msg);

        ByteBuf encoded = out.readOutbound();
        out.finish();

        return encoded;
    }
}

Frequently Asked Questions

What is the Socks5CommonTestUtils class?
Socks5CommonTestUtils is a class in the netty codebase, defined in codec-socks/src/test/java/io/netty/handler/codec/socksx/v5/Socks5CommonTestUtils.java.
Where is Socks5CommonTestUtils defined?
Socks5CommonTestUtils is defined in codec-socks/src/test/java/io/netty/handler/codec/socksx/v5/Socks5CommonTestUtils.java at line 21.

Analyze Your Own Codebase

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

Try Supermodel Free