Class HttpContentDecompressor
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.MessageToMessageDecoder<HttpObject>
io.netty.handler.codec.http.HttpContentDecoder
io.netty.handler.codec.http.HttpContentDecompressor
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Decompresses an
HttpMessage and an HttpContent compressed in
gzip or deflate encoding. For more information on how this
handler modifies the message, please refer to HttpContentDecoder.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.SharableModifier and TypeInterfaceDescriptionstatic @interfaceIndicates that the same instance of the annotatedChannelHandlercan be added to one or moreChannelPipelines multiple times without a race condition. -
Field Summary
Fields inherited from class HttpContentDecoder
ctx -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.HttpContentDecompressor(boolean strict) Deprecated.HttpContentDecompressor(boolean strict, int maxAllocation) Create a newHttpContentDecompressor.HttpContentDecompressor(int maxAllocation) Create a newHttpContentDecompressorin non-strict mode. -
Method Summary
Modifier and TypeMethodDescriptionprotected EmbeddedChannelnewContentDecoder(String contentEncoding) Returns a newEmbeddedChannelthat decodes the HTTP message content encoded in the specified contentEncoding.Methods inherited from class HttpContentDecoder
channelInactive, channelReadComplete, decode, getTargetContentEncoding, handlerAdded, handlerRemovedModifier and TypeMethodDescriptionvoidCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelReadComplete()to forward to the nextChannelInboundHandlerin theChannelPipeline.protected voiddecode(ChannelHandlerContext ctx, HttpObject msg, List<Object> out) Decode from one message to an other.protected StringgetTargetContentEncoding(String contentEncoding) Returns the expected content encoding of the decoded content.voidDo nothing by default, sub-classes may override this method.voidDo nothing by default, sub-classes may override this method.Methods inherited from class MessageToMessageDecoder
acceptInboundMessage, channelReadModifier and TypeMethodDescriptionbooleanReturnstrueif the given message should be handled.voidchannelRead(ChannelHandlerContext ctx, Object msg) CallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.Methods inherited from class ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredModifier and TypeMethodDescriptionvoidCallsChannelHandlerContext.fireChannelActive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelRegistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelUnregistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelWritabilityChanged()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) CallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline.voiduserEventTriggered(ChannelHandlerContext ctx, Object evt) CallsChannelHandlerContext.fireUserEventTriggered(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.Methods inherited from class ChannelHandlerAdapter
ensureNotSharable, isSharableModifier and TypeMethodDescriptionprotected voidbooleanReturntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
Constructor Details
-
HttpContentDecompressor
Deprecated.Create a newHttpContentDecompressorin non-strict mode. -
HttpContentDecompressor
public HttpContentDecompressor(int maxAllocation) Create a newHttpContentDecompressorin non-strict mode.- Parameters:
maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
HttpContentDecompressor
Deprecated.Create a newHttpContentDecompressor.- Parameters:
strict- iftrueuse strict handling of deflate if used, otherwise handle it in a more lenient fashion.
-
HttpContentDecompressor
public HttpContentDecompressor(boolean strict, int maxAllocation) Create a newHttpContentDecompressor.- Parameters:
strict- iftrueuse strict handling of deflate if used, otherwise handle it in a more lenient fashion.maxAllocation- Maximum size of the decompression buffer. Must be >= 0. If zero, maximum size is not limited.
-
-
Method Details
-
newContentDecoder
Description copied from class:HttpContentDecoderReturns a newEmbeddedChannelthat decodes the HTTP message content encoded in the specified contentEncoding.- Specified by:
newContentDecoderin classHttpContentDecoder- Parameters:
contentEncoding- the value of the"Content-Encoding"header- Returns:
- a new
EmbeddedChannelif the specified encoding is supported.nullotherwise (alternatively, you can throw an exception to block unknown encoding). - Throws:
Exception
-
HttpContentDecompressor(int).