Class PerMessageDeflateDecoder
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
io.netty.handler.codec.http.websocketx.extensions.compression.PerMessageDeflateDecoder
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Per-message implementation of deflate decompressor.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsFields inherited from class DeflateDecoder
EMPTY_DEFLATE_BLOCK, FRAME_TAIL -
Constructor Summary
ConstructorsConstructorDescriptionPerMessageDeflateDecoder(boolean noContext, int maxAllocation) ConstructorPerMessageDeflateDecoder(boolean noContext, WebSocketExtensionFilter extensionDecoderFilter, int maxAllocation) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the given message should be handled.protected booleanprotected voiddecode(ChannelHandlerContext ctx, WebSocketFrame msg, List<Object> out) Decode from one message to an other.protected intnewRsv(WebSocketFrame msg) Methods inherited from class DeflateDecoder
channelInactive, extensionDecoderFilter, handlerRemovedMethods inherited from class MessageToMessageDecoder
channelRead, channelReadCompleteMethods inherited from class ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
handlerAdded
-
Field Details
-
compressing
private boolean compressing
-
-
Constructor Details
-
PerMessageDeflateDecoder
PerMessageDeflateDecoder(boolean noContext, int maxAllocation) Constructor- Parameters:
noContext- true to disable context takeover.maxAllocation- maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
PerMessageDeflateDecoder
PerMessageDeflateDecoder(boolean noContext, WebSocketExtensionFilter extensionDecoderFilter, int maxAllocation) Constructor- Parameters:
noContext- true to disable context takeover.extensionDecoderFilter- extension decoder for per message deflate decoder.maxAllocation- maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
-
Method Details
-
acceptInboundMessage
Description copied from class:MessageToMessageDecoderReturnstrueif the given message should be handled. Iffalseit will be passed to the nextChannelInboundHandlerin theChannelPipeline.- Overrides:
acceptInboundMessagein classMessageToMessageDecoder<WebSocketFrame>- Throws:
Exception
-
newRsv
- Specified by:
newRsvin classDeflateDecoder
-
appendFrameTail
- Specified by:
appendFrameTailin classDeflateDecoder
-
decode
protected void decode(ChannelHandlerContext ctx, WebSocketFrame msg, List<Object> out) throws 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.- Overrides:
decodein classDeflateDecoder- Parameters:
ctx- theChannelHandlerContextwhich thisMessageToMessageDecoderbelongs tomsg- the message to decode to an other oneout- theListto which decoded messages should be added- Throws:
Exception- is thrown if an error occurs
-