Class DeflateDecoder
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.MessageToMessageDecoder<WebSocketFrame>
-
- io.netty.handler.codec.http.websocketx.extensions.WebSocketExtensionDecoder
-
- io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder
-
- All Implemented Interfaces:
ChannelHandler
,ChannelInboundHandler
- Direct Known Subclasses:
PerFrameDeflateDecoder
,PerMessageDeflateDecoder
abstract class DeflateDecoder extends WebSocketExtensionDecoder
Deflate implementation of a payload decompressor for io.netty.handler.codec.http.websocketx.WebSocketFrame.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private EmbeddedChannel
decoder
(package private) static ByteBuf
EMPTY_DEFLATE_BLOCK
private WebSocketExtensionFilter
extensionDecoderFilter
(package private) static ByteBuf
FRAME_TAIL
private boolean
noContext
-
Constructor Summary
Constructors Constructor Description DeflateDecoder(boolean noContext, WebSocketExtensionFilter extensionDecoderFilter)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract boolean
appendFrameTail(WebSocketFrame msg)
void
channelInactive(ChannelHandlerContext ctx)
CallsChannelHandlerContext.fireChannelInactive()
to forward to the nextChannelInboundHandler
in theChannelPipeline
.private void
cleanup()
protected void
decode(ChannelHandlerContext ctx, WebSocketFrame msg, java.util.List<java.lang.Object> out)
Decode from one message to an other.private ByteBuf
decompressContent(ChannelHandlerContext ctx, WebSocketFrame msg)
protected WebSocketExtensionFilter
extensionDecoderFilter()
Returns the extension decoder filter.void
handlerRemoved(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.protected abstract int
newRsv(WebSocketFrame msg)
-
Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead, channelReadComplete
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded
-
-
-
-
Field Detail
-
FRAME_TAIL
static final ByteBuf FRAME_TAIL
-
EMPTY_DEFLATE_BLOCK
static final ByteBuf EMPTY_DEFLATE_BLOCK
-
noContext
private final boolean noContext
-
extensionDecoderFilter
private final WebSocketExtensionFilter extensionDecoderFilter
-
decoder
private EmbeddedChannel decoder
-
-
Constructor Detail
-
DeflateDecoder
DeflateDecoder(boolean noContext, WebSocketExtensionFilter extensionDecoderFilter)
Constructor- Parameters:
noContext
- true to disable context takeover.extensionDecoderFilter
- extension decoder filter.
-
-
Method Detail
-
extensionDecoderFilter
protected WebSocketExtensionFilter extensionDecoderFilter()
Returns the extension decoder filter.
-
appendFrameTail
protected abstract boolean appendFrameTail(WebSocketFrame msg)
-
newRsv
protected abstract int newRsv(WebSocketFrame msg)
-
decode
protected void decode(ChannelHandlerContext ctx, WebSocketFrame msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
Description copied from class:MessageToMessageDecoder
Decode from one message to an other. This method will be called for each written message that can be handled by this decoder.- Specified by:
decode
in classMessageToMessageDecoder<WebSocketFrame>
- Parameters:
ctx
- theChannelHandlerContext
which thisMessageToMessageDecoder
belongs tomsg
- the message to decode to an other oneout
- theList
to which decoded messages should be added- Throws:
java.lang.Exception
- is thrown if an error occurs
-
handlerRemoved
public void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from class:ChannelHandlerAdapter
Do nothing by default, sub-classes may override this method.- Specified by:
handlerRemoved
in interfaceChannelHandler
- Overrides:
handlerRemoved
in classChannelHandlerAdapter
- Throws:
java.lang.Exception
-
channelInactive
public void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from class:ChannelInboundHandlerAdapter
CallsChannelHandlerContext.fireChannelInactive()
to forward to the nextChannelInboundHandler
in theChannelPipeline
. Sub-classes may override this method to change behavior.- Specified by:
channelInactive
in interfaceChannelInboundHandler
- Overrides:
channelInactive
in classChannelInboundHandlerAdapter
- Throws:
java.lang.Exception
-
decompressContent
private ByteBuf decompressContent(ChannelHandlerContext ctx, WebSocketFrame msg)
-
cleanup
private void cleanup()
-
-