Top Description Fields Constructors Methods
io.netty.handler.codec.socksx.v5

public Class Socks5ClientEncoder

extends MessageToByteEncoder<Socks5Message>
Class Inheritance
Annotations
@Sharable
Imports
io.netty.buffer.ByteBuf, .ByteBufUtil, io.netty.channel.ChannelHandler.Sharable, .ChannelHandlerContext, io.netty.handler.codec.EncoderException, .MessageToByteEncoder, io.netty.util.internal.ObjectUtil, .StringUtil, java.util.List, .RandomAccess

Encodes a client-side Socks5Message into a ByteBuf.

Field Summary

Modifier and TypeField and Description
private final Socks5AddressEncoder
public static final Socks5ClientEncoder

Constructor Summary

AccessConstructor and Description
protected
Socks5ClientEncoder()

Creates a new instance with the default Socks5AddressEncoder.

public
Socks5ClientEncoder(Socks5AddressEncoder addressEncoder)

Creates a new instance with the specified Socks5AddressEncoder.

Method Summary

Modifier and TypeMethod and Description
protected final Socks5AddressEncoder
addressEncoder()

Returns the Socks5AddressEncoder of this encoder.

protected void
encode(ChannelHandlerContext ctx, Socks5Message
the message to encode
msg
,
ByteBuf
the ByteBuf into which the encoded message will be written
out
)

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf.
private static void
private void
private static void
Inherited from io.netty.handler.codec.MessageToByteEncoder:
acceptOutboundMessageallocateBufferisPreferDirectwrite

Field Detail

addressEncoderback to summary
private final Socks5AddressEncoder addressEncoder
DEFAULTback to summary
public static final Socks5ClientEncoder DEFAULT

Constructor Detail

Socks5ClientEncoderback to summary
protected Socks5ClientEncoder()

Creates a new instance with the default Socks5AddressEncoder.

Socks5ClientEncoderback to summary
public Socks5ClientEncoder(Socks5AddressEncoder addressEncoder)

Creates a new instance with the specified Socks5AddressEncoder.

Method Detail

addressEncoderback to summary
protected final Socks5AddressEncoder addressEncoder()

Returns the Socks5AddressEncoder of this encoder.

encodeback to summary
protected void encode(ChannelHandlerContext ctx, Socks5Message msg, ByteBuf out) throws Exception

Implements abstract io.netty.handler.codec.MessageToByteEncoder.encode.

Doc from io.netty.handler.codec.MessageToByteEncoder.encode.

Encode a message into a ByteBuf. This method will be called for each written message that can be handled by this encoder.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToByteEncoder belongs to

msg:Socks5Message

the message to encode

out:ByteBuf

the ByteBuf into which the encoded message will be written

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
encodeAuthMethodRequestback to summary
private static void encodeAuthMethodRequest(Socks5InitialRequest msg, ByteBuf out)
encodeCommandRequestback to summary
private void encodeCommandRequest(Socks5CommandRequest msg, ByteBuf out) throws Exception
encodePasswordAuthRequestback to summary
private static void encodePasswordAuthRequest(Socks5PasswordAuthRequest msg, ByteBuf out)