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 EmbeddedChanneldecoder(package private) static ByteBufEMPTY_DEFLATE_BLOCKprivate WebSocketExtensionFilterextensionDecoderFilter(package private) static ByteBufFRAME_TAILprivate booleannoContext
-
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 booleanappendFrameTail(WebSocketFrame msg)voidchannelInactive(ChannelHandlerContext ctx)CallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline.private voidcleanup()protected voiddecode(ChannelHandlerContext ctx, WebSocketFrame msg, java.util.List<java.lang.Object> out)Decode from one message to an other.private ByteBufdecompressContent(ChannelHandlerContext ctx, WebSocketFrame msg)protected WebSocketExtensionFilterextensionDecoderFilter()Returns the extension decoder filter.voidhandlerRemoved(ChannelHandlerContext ctx)Do nothing by default, sub-classes may override this method.protected abstract intnewRsv(WebSocketFrame msg)-
Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, 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:MessageToMessageDecoderDecode from one message to an other. This method will be called for each written message that can be handled by this decoder.- Specified by:
decodein classMessageToMessageDecoder<WebSocketFrame>- Parameters:
ctx- theChannelHandlerContextwhich thisMessageToMessageDecoderbelongs tomsg- the message to decode to an other oneout- theListto 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:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerRemovedin interfaceChannelHandler- Overrides:
handlerRemovedin classChannelHandlerAdapter- Throws:
java.lang.Exception
-
channelInactive
public void channelInactive(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
channelInactivein interfaceChannelInboundHandler- Overrides:
channelInactivein classChannelInboundHandlerAdapter- Throws:
java.lang.Exception
-
decompressContent
private ByteBuf decompressContent(ChannelHandlerContext ctx, WebSocketFrame msg)
-
cleanup
private void cleanup()
-
-