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

public final Class Socks4ServerEncoder

extends MessageToByteEncoder<Socks4CommandResponse>
Class Inheritance
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandlerContext, io.netty5.handler.codec.MessageToByteEncoder, io.netty5.util.NetUtil

Encodes a Socks4CommandResponse into a Buffer.

Field Summary

Modifier and TypeField and Description
public static final Socks4ServerEncoder
private static final byte[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Buffer
protected void
encode(ChannelHandlerContext ctx, Socks4CommandResponse
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 Socks4ServerEncoder INSTANCE
IPv4_HOSTNAME_ZEROEDback to summary
private static final byte[] IPv4_HOSTNAME_ZEROED

Constructor Detail

Socks4ServerEncoderback to summary
private Socks4ServerEncoder()

Method Detail

allocateBufferback to summary
protected Buffer allocateBuffer(ChannelHandlerContext ctx, Socks4CommandResponse 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:Socks4CommandResponse

the message to be encoded

Annotations
@Override
encodeback to summary
protected void encode(ChannelHandlerContext ctx, Socks4CommandResponse 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:Socks4CommandResponse

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