decode() — netty Function Reference
Architecture documentation for the decode() function in SocksInitRequestDecoder.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD edfa33e2_a9cb_7087_66cd_9de08e5caccc["decode()"] eb14949c_0997_e4e8_ab21_876b722c6daa["SocksInitRequestDecoder"] edfa33e2_a9cb_7087_66cd_9de08e5caccc -->|defined in| eb14949c_0997_e4e8_ab21_876b722c6daa style edfa33e2_a9cb_7087_66cd_9de08e5caccc fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-socks/src/main/java/io/netty/handler/codec/socks/SocksInitRequestDecoder.java lines 38–67
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf byteBuf, List<Object> out) throws Exception {
switch (state()) {
case CHECK_PROTOCOL_VERSION: {
if (byteBuf.readByte() != SocksProtocolVersion.SOCKS5.byteValue()) {
out.add(SocksCommonUtils.UNKNOWN_SOCKS_REQUEST);
break;
}
checkpoint(State.READ_AUTH_SCHEMES);
}
case READ_AUTH_SCHEMES: {
final byte authSchemeNum = byteBuf.readByte();
final List<SocksAuthScheme> authSchemes;
if (authSchemeNum > 0) {
authSchemes = new ArrayList<SocksAuthScheme>(authSchemeNum);
for (int i = 0; i < authSchemeNum; i++) {
authSchemes.add(SocksAuthScheme.valueOf(byteBuf.readByte()));
}
} else {
authSchemes = Collections.emptyList();
}
out.add(new SocksInitRequest(authSchemes));
break;
}
default: {
throw new Error("Unexpected request decoder type: " + state());
}
}
ctx.pipeline().remove(this);
}
Domain
Subdomains
Source
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/SocksInitRequestDecoder.java.
Where is decode() defined?
decode() is defined in codec-socks/src/main/java/io/netty/handler/codec/socks/SocksInitRequestDecoder.java at line 38.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free