Home / Function/ decode() — netty Function Reference

decode() — netty Function Reference

Architecture documentation for the decode() function in SocksAuthResponseDecoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9efcf727_01a9_6a8d_f457_6cbe174dbc74["decode()"]
  4109b9d0_e2a6_6dbe_8941_6bda26ca13c3["SocksAuthResponseDecoder"]
  9efcf727_01a9_6a8d_f457_6cbe174dbc74 -->|defined in| 4109b9d0_e2a6_6dbe_8941_6bda26ca13c3
  style 9efcf727_01a9_6a8d_f457_6cbe174dbc74 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthResponseDecoder.java lines 36–57

    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> out)
            throws Exception {
        switch (state()) {
            case CHECK_PROTOCOL_VERSION: {
                if (byteBuf.readByte() != SocksSubnegotiationVersion.AUTH_PASSWORD.byteValue()) {
                    out.add(SocksCommonUtils.UNKNOWN_SOCKS_RESPONSE);
                    break;
                }
                checkpoint(State.READ_AUTH_RESPONSE);
            }
            case READ_AUTH_RESPONSE: {
                SocksAuthStatus authStatus = SocksAuthStatus.valueOf(byteBuf.readByte());
                out.add(new SocksAuthResponse(authStatus));
                break;
            }
            default: {
                throw new Error("Unexpected response decoder state: " + state());
            }
        }
        channelHandlerContext.pipeline().remove(this);
    }

Domain

Subdomains

Frequently Asked Questions

What does decode() do?
decode() is a function in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthResponseDecoder.java.
Where is decode() defined?
decode() is defined in codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthResponseDecoder.java at line 36.

Analyze Your Own Codebase

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

Try Supermodel Free