- 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 void
channelInactive(ChannelHandlerContext ctx)
TheChannel
of theChannelHandlerContext
was registered is now inactive and reached its end of lifetime.protected void
decode(ChannelHandlerContext ctx, Buffer in)
Decode the from oneBuffer
to another.protected void
handlerAdded0(ChannelHandlerContext ctx)
protected void
handlerRemoved0(ChannelHandlerContext ctx)
Gets called after theByteToMessageDecoder
was 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
- theSupplier
that is used to create theDecompressor
.
-
DecompressionHandler
public DecompressionHandler(Supplier<? extends Decompressor> decompressorSupplier, boolean discardBytesAfterFinished)
Creates a new instance.- Parameters:
decompressorSupplier
- theSupplier
that is used to create theDecompressor
.discardBytesAfterFinished
-true
if the bytes should be discarded after theCompressor
finished the compression of the whole stream.
-
-
Method Detail
-
handlerAdded0
protected void handlerAdded0(ChannelHandlerContext ctx) throws Exception
- Overrides:
handlerAdded0
in classByteToMessageDecoder
- Throws:
Exception
-
decode
protected void decode(ChannelHandlerContext ctx, Buffer in) throws Exception
Description copied from class:ByteToMessageDecoder
Decode the from oneBuffer
to another. This method will be called till either the inputBuffer
has nothing to read when return from this method or till nothing was read from the inputBuffer
.- Specified by:
decode
in classByteToMessageDecoder
- Parameters:
ctx
- theChannelHandlerContext
which thisByteToMessageDecoder
belongs toin
- theBuffer
from which to read data- Throws:
Exception
- is thrown if an error occurs
-
handlerRemoved0
protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception
Description copied from class:ByteToMessageDecoder
Gets called after theByteToMessageDecoder
was removed from the actual context and it doesn't handle events anymore.- Overrides:
handlerRemoved0
in classByteToMessageDecoder
- Throws:
Exception
-
channelInactive
public void channelInactive(ChannelHandlerContext ctx) throws Exception
Description copied from interface:ChannelHandler
TheChannel
of theChannelHandlerContext
was registered is now inactive and reached its end of lifetime.- Specified by:
channelInactive
in interfaceChannelHandler
- Overrides:
channelInactive
in classByteToMessageDecoder
- Throws:
Exception
-
-