Top Description Constructors Methods
io.netty.contrib.handler.codec.socks

public Class SocksMessageEncoder

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

Encodes an SocksMessage into a Buffer. MessageToByteEncoder implementation. Use this with SocksInitRequest, SocksInitResponse, SocksAuthRequest, SocksAuthResponse, SocksCmdRequest and SocksCmdResponse

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Buffer
allocateBuffer(ChannelHandlerContext ctx, SocksMessage
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, SocksMessage
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

Constructor Detail

SocksMessageEncoderback to summary
public SocksMessageEncoder()

Method Detail

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

the message to be encoded

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

the message to encode

out:Buffer

the Buffer into which the encoded message will be written

Annotations
@Override
@SuppressWarnings:deprecation
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