public class Socks5CommandResponseDecoder extends ReplayingDecoder<io.netty.handler.codec.socksx.v5.Socks5CommandResponseDecoder.State>
ByteBuf
解码单个Socks5CommandResponse
。
在成功解码时,该解码器会将接收到的数据转发到下一个处理程序,以便其他处理程序可以在稍后移除或替换此解码程序。
解码失败时,该解码器将丢弃接收到的数据,以便其他处理程序稍后关闭连接。
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
Socks5CommandResponseDecoder() |
Socks5CommandResponseDecoder(Socks5AddressDecoder addressDecoder) |
Modifier and Type | Method and Description |
---|---|
protected void |
decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
解码从一个 ByteBuf 到另一个。
|
callDecode, checkpoint, checkpoint, state, state
actualReadableBytes, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
ensureNotSharable, handlerAdded, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded
public Socks5CommandResponseDecoder()
public Socks5CommandResponseDecoder(Socks5AddressDecoder addressDecoder)
protected void decode(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) throws java.lang.Exception
ByteToMessageDecoder
decode
ByteToMessageDecoder
ctx
- ByteToMessageDecoder
属于的ChannelHandlerContext
in
- 从中读取数据的ByteBuf
out
- 应该添加解码消息的
List
java.lang.Exception
- 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.