encodeAsByteBuf() — netty Function Reference
Architecture documentation for the encodeAsByteBuf() function in SocksCmdRequest.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 1866831d_58ce_9d5c_e5ba_2ef98136037c["encodeAsByteBuf()"] 4c77f215_7f5b_19c4_455f_987dda36774c["SocksCmdRequest"] 1866831d_58ce_9d5c_e5ba_2ef98136037c -->|defined in| 4c77f215_7f5b_19c4_455f_987dda36774c style 1866831d_58ce_9d5c_e5ba_2ef98136037c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdRequest.java lines 110–136
@Override
public void encodeAsByteBuf(ByteBuf byteBuf) {
byteBuf.writeByte(protocolVersion().byteValue());
byteBuf.writeByte(cmdType.byteValue());
byteBuf.writeByte(0x00);
byteBuf.writeByte(addressType.byteValue());
switch (addressType) {
case IPv4: {
byteBuf.writeBytes(NetUtil.createByteArrayFromIpAddressString(host));
ByteBufUtil.writeShortBE(byteBuf, port);
break;
}
case DOMAIN: {
byteBuf.writeByte(host.length());
byteBuf.writeCharSequence(host, CharsetUtil.US_ASCII);
ByteBufUtil.writeShortBE(byteBuf, port);
break;
}
case IPv6: {
byteBuf.writeBytes(NetUtil.createByteArrayFromIpAddressString(host));
ByteBufUtil.writeShortBE(byteBuf, port);
break;
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does encodeAsByteBuf() do?
encodeAsByteBuf() is a function in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdRequest.java.
Where is encodeAsByteBuf() defined?
encodeAsByteBuf() is defined in codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdRequest.java at line 110.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free