decode() — netty Function Reference
Architecture documentation for the decode() function in Socks5CommandResponseDecoder.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD a718f076_b7bf_6fc3_a00d_26dbaf880859["decode()"] b53af1b4_09b5_0fac_55e3_d5fcdb0017dd["Socks5CommandResponseDecoder"] a718f076_b7bf_6fc3_a00d_26dbaf880859 -->|defined in| b53af1b4_09b5_0fac_55e3_d5fcdb0017dd 7a7f9937_ea59_fccf_5203_1c354e63f498["fail()"] a718f076_b7bf_6fc3_a00d_26dbaf880859 -->|calls| 7a7f9937_ea59_fccf_5203_1c354e63f498 style a718f076_b7bf_6fc3_a00d_26dbaf880859 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/Socks5CommandResponseDecoder.java lines 58–92
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
try {
switch (state()) {
case INIT: {
final byte version = in.readByte();
if (version != SocksVersion.SOCKS5.byteValue()) {
throw new DecoderException(
"unsupported version: " + version + " (expected: " + SocksVersion.SOCKS5.byteValue() + ')');
}
final Socks5CommandStatus status = Socks5CommandStatus.valueOf(in.readByte());
in.skipBytes(1); // Reserved
final Socks5AddressType addrType = Socks5AddressType.valueOf(in.readByte());
final String addr = addressDecoder.decodeAddress(addrType, in);
final int port = ByteBufUtil.readUnsignedShortBE(in);
out.add(new DefaultSocks5CommandResponse(status, addrType, addr, port));
checkpoint(State.SUCCESS);
}
case SUCCESS: {
int readableBytes = actualReadableBytes();
if (readableBytes > 0) {
out.add(in.readRetainedSlice(readableBytes));
}
break;
}
case FAILURE: {
in.skipBytes(actualReadableBytes());
break;
}
}
} catch (Exception e) {
fail(out, e);
}
}
Domain
Subdomains
Defined In
Calls
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/socksx/v5/Socks5CommandResponseDecoder.java.
Where is decode() defined?
decode() is defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/Socks5CommandResponseDecoder.java at line 58.
What does decode() call?
decode() calls 1 function(s): fail.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free