- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.ByteToMessageDecoder
-
- io.netty5.handler.codec.compression.DecompressionHandler
-
- All Implemented Interfaces:
ChannelHandler
public final class DecompressionHandler extends ByteToMessageDecoder
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.netty5.handler.codec.ByteToMessageDecoder
ByteToMessageDecoder.Cumulator
-
-
Field Summary
-
Fields inherited from class io.netty5.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
-
-
Constructor Summary
Constructors Constructor Description DecompressionHandler(Supplier<? extends Decompressor> decompressorSupplier)Creates a new instance.DecompressionHandler(Supplier<? extends Decompressor> decompressorSupplier, boolean discardBytesAfterFinished)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchannelInactive(ChannelHandlerContext ctx)TheChannelof theChannelHandlerContextwas registered is now inactive and reached its end of lifetime.protected voiddecode(ChannelHandlerContext ctx, Buffer in)Decode the from oneBufferto another.protected voidhandlerAdded0(ChannelHandlerContext ctx)protected voidhandlerRemoved0(ChannelHandlerContext ctx)Gets called after theByteToMessageDecoderwas removed from the actual context and it doesn't handle events anymore.-
Methods inherited from class io.netty5.handler.codec.ByteToMessageDecoder
actualReadableBytes, channelRead, channelReadComplete, channelShutdown, decodeLast, discardSomeReadBytes, handlerAdded, handlerRemoved, internalBuffer, isSharable, isSingleDecode, setSingleDecode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInboundEvent, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
-
-
-
Constructor Detail
-
DecompressionHandler
public DecompressionHandler(Supplier<? extends Decompressor> decompressorSupplier)
Creates a new instance.- Parameters:
decompressorSupplier- theSupplierthat is used to create theDecompressor.
-
DecompressionHandler
public DecompressionHandler(Supplier<? extends Decompressor> decompressorSupplier, boolean discardBytesAfterFinished)
Creates a new instance.- Parameters:
decompressorSupplier- theSupplierthat is used to create theDecompressor.discardBytesAfterFinished-trueif the bytes should be discarded after theCompressorfinished the compression of the whole stream.
-
-
Method Detail
-
handlerAdded0
protected void handlerAdded0(ChannelHandlerContext ctx) throws Exception
- Overrides:
handlerAdded0in classByteToMessageDecoder- Throws:
Exception
-
decode
protected void decode(ChannelHandlerContext ctx, Buffer in) throws Exception
Description copied from class:ByteToMessageDecoderDecode the from oneBufferto another. This method will be called till either the inputBufferhas nothing to read when return from this method or till nothing was read from the inputBuffer.- Specified by:
decodein classByteToMessageDecoder- Parameters:
ctx- theChannelHandlerContextwhich thisByteToMessageDecoderbelongs toin- theBufferfrom which to read data- Throws:
Exception- is thrown if an error occurs
-
handlerRemoved0
protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception
Description copied from class:ByteToMessageDecoderGets called after theByteToMessageDecoderwas removed from the actual context and it doesn't handle events anymore.- Overrides:
handlerRemoved0in classByteToMessageDecoder- Throws:
Exception
-
channelInactive
public void channelInactive(ChannelHandlerContext ctx) throws Exception
Description copied from interface:ChannelHandlerTheChannelof theChannelHandlerContextwas registered is now inactive and reached its end of lifetime.- Specified by:
channelInactivein interfaceChannelHandler- Overrides:
channelInactivein classByteToMessageDecoder- Throws:
Exception
-
-