Home / Function/ encode() — netty Function Reference

encode() — netty Function Reference

Architecture documentation for the encode() function in Socks4ClientEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  4d5a76d9_f907_b020_9b5e_9dddf5760d1a["encode()"]
  290d24f3_ad46_b684_ff61_0cb22ac2823c["Socks4ClientEncoder"]
  4d5a76d9_f907_b020_9b5e_9dddf5760d1a -->|defined in| 290d24f3_ad46_b684_ff61_0cb22ac2823c
  style 4d5a76d9_f907_b020_9b5e_9dddf5760d1a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ClientEncoder.java lines 43–59

    @Override
    protected void encode(ChannelHandlerContext ctx, Socks4CommandRequest msg, ByteBuf out) throws Exception {
        out.writeByte(msg.version().byteValue());
        out.writeByte(msg.type().byteValue());
        ByteBufUtil.writeShortBE(out, msg.dstPort());
        if (NetUtil.isValidIpV4Address(msg.dstAddr())) {
            out.writeBytes(NetUtil.createByteArrayFromIpAddressString(msg.dstAddr()));
            ByteBufUtil.writeAscii(out, msg.userId());
            out.writeByte(0);
        } else {
            out.writeBytes(IPv4_DOMAIN_MARKER);
            ByteBufUtil.writeAscii(out, msg.userId());
            out.writeByte(0);
            ByteBufUtil.writeAscii(out, msg.dstAddr());
            out.writeByte(0);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does encode() do?
encode() is a function in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ClientEncoder.java.
Where is encode() defined?
encode() is defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v4/Socks4ClientEncoder.java at line 43.

Analyze Your Own Codebase

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

Try Supermodel Free