Top Description Fields Constructors Methods
io.netty.contrib.handler.codec.socksx.v4

public final Class Socks4ClientEncoder

extends MessageToByteEncoder<Socks4CommandRequest>
Class Inheritance
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandlerContext, io.netty5.handler.codec.MessageToByteEncoder, java.nio.charset.StandardCharsets, io.netty5.util.NetUtil

Encodes a Socks4CommandRequest into a Buffer.

Field Summary

Modifier and TypeField and Description
public static final Socks4ClientEncoder
INSTANCE

The singleton instance of Socks4ClientEncoder

private static final byte[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Buffer
allocateBuffer(ChannelHandlerContext ctx, Socks4CommandRequest
the message to be encoded
msg
)

Implements abstract io.netty5.handler.codec.MessageToByteEncoder.allocateBuffer.

Allocate a Buffer which will be used as argument of encode(ChannelHandlerContext, I, Buffer).
protected void
encode(ChannelHandlerContext ctx, Socks4CommandRequest
the message to encode
msg
,
Buffer
the Buffer into which the encoded message will be written
out
)

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

Encode a message into a Buffer.
public boolean
isSharable()

Overrides default io.netty5.channel.ChannelHandler.isSharable.

Returns true if this handler is sharable and thus can be added to more than one ChannelPipeline.
Inherited from io.netty5.handler.codec.MessageToByteEncoder:
acceptOutboundMessagewrite

Field Detail

INSTANCEback to summary
public static final Socks4ClientEncoder INSTANCE

The singleton instance of Socks4ClientEncoder

IPv4_DOMAIN_MARKERback to summary
private static final byte[] IPv4_DOMAIN_MARKER

Constructor Detail

Socks4ClientEncoderback to summary
private Socks4ClientEncoder()

Method Detail

allocateBufferback to summary
protected Buffer allocateBuffer(ChannelHandlerContext ctx, Socks4CommandRequest msg)

Implements abstract io.netty5.handler.codec.MessageToByteEncoder.allocateBuffer.

Doc from io.netty5.handler.codec.MessageToByteEncoder.allocateBuffer.

Allocate a Buffer which will be used as argument of encode(ChannelHandlerContext, I, Buffer).

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this MessageToByteEncoder belongs to

msg:Socks4CommandRequest

the message to be encoded

Annotations
@Override
encodeback to summary
protected void encode(ChannelHandlerContext ctx, Socks4CommandRequest msg, Buffer out)

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

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

Encode a message into a Buffer. 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:Socks4CommandRequest

the message to encode

out:Buffer

the Buffer into which the encoded message will be written

Annotations
@Override
isSharableback to summary
public boolean isSharable()

Overrides default io.netty5.channel.ChannelHandler.isSharable.

Doc from io.netty5.channel.ChannelHandler.isSharable.

Returns true if this handler is sharable and thus can be added to more than one ChannelPipeline. By default, this method returns false. If this method returns false, you have to create a new handler instance every time you add it to a pipeline because it has unshared state such as member variables.

Annotations
@Override