Top Description Fields Constructors Methods
io.netty5.handler.codec.compression

public final Class DecompressionHandler

extends ByteToMessageDecoder
Class Inheritance
Imports
io.netty5.buffer.Buffer, io.netty5.channel.ChannelHandlerContext, io.netty5.handler.codec.ByteToMessageDecoder, java.util.Objects, java.util.function.Supplier

ByteToMessageDecoder that uses a Decompressor for decompressing incoming Buffers.

Field Summary

Modifier and TypeField and Description
private Decompressor
private final Supplier<? extends Decompressor>
private final boolean
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public
DecompressionHandler(Supplier<? extends Decompressor>
the Supplier that is used to create the Decompressor.
decompressorSupplier
)

Creates a new instance.

public
DecompressionHandler(Supplier<? extends Decompressor>
the Supplier that is used to create the Decompressor.
decompressorSupplier
,
boolean
true if the bytes should be discarded after the Compressor finished the compression of the whole stream.
discardBytesAfterFinished
)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public void
channelInactive(ChannelHandlerContext ctx)

Overrides io.netty5.handler.codec.ByteToMessageDecoder.channelInactive.

Overrides default io.netty5.channel.ChannelHandler.channelInactive.

The Channel of the ChannelHandlerContext was registered is now inactive and reached its end of lifetime.
private void
protected void
decode(ChannelHandlerContext ctx, Buffer
the Buffer from which to read data
in
)

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another.
protected void
protected void
handlerRemoved0(ChannelHandlerContext ctx)

Overrides io.netty5.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle events anymore.
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
actualReadableByteschannelReadchannelReadCompletechannelShutdowndecodeLastdiscardSomeReadByteshandlerAddedhandlerRemovedinternalBufferisSharableisSingleDecodesetSingleDecode

Field Detail

decompressorback to summary
private Decompressor decompressor
decompressorSupplierback to summary
private final Supplier<? extends Decompressor> decompressorSupplier
discardBytesAfterFinishedback to summary
private final boolean discardBytesAfterFinished

Constructor Detail

DecompressionHandlerback to summary
public DecompressionHandler(Supplier<? extends Decompressor> decompressorSupplier)

Creates a new instance.

Parameters
decompressorSupplier:Supplier<? extends Decompressor>

the Supplier that is used to create the Decompressor.

DecompressionHandlerback to summary
public DecompressionHandler(Supplier<? extends Decompressor> decompressorSupplier, boolean discardBytesAfterFinished)

Creates a new instance.

Parameters
decompressorSupplier:Supplier<? extends Decompressor>

the Supplier that is used to create the Decompressor.

discardBytesAfterFinished:boolean

true if the bytes should be discarded after the Compressor finished the compression of the whole stream.

Method Detail

channelInactiveback to summary
public void channelInactive(ChannelHandlerContext ctx) throws Exception

Overrides io.netty5.handler.codec.ByteToMessageDecoder.channelInactive.

Overrides default io.netty5.channel.ChannelHandler.channelInactive.

Doc from io.netty5.channel.ChannelHandler.channelInactive.

The Channel of the ChannelHandlerContext was registered is now inactive and reached its end of lifetime.

Annotations
@Override
closeDecompressorback to summary
private void closeDecompressor()
decodeback to summary
protected void decode(ChannelHandlerContext ctx, Buffer in) throws Exception

Implements abstract io.netty5.handler.codec.ByteToMessageDecoder.decode.

Doc from io.netty5.handler.codec.ByteToMessageDecoder.decode.

Decode the from one Buffer to another. This method will be called till either the input Buffer has nothing to read when return from this method or till nothing was read from the input Buffer.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:Buffer

the Buffer from which to read data

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurs
handlerAdded0back to summary
protected void handlerAdded0(ChannelHandlerContext ctx) throws Exception

Overrides io.netty5.handler.codec.ByteToMessageDecoder.handlerAdded0.

Annotations
@Override
handlerRemoved0back to summary
protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception

Overrides io.netty5.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Doc from io.netty5.handler.codec.ByteToMessageDecoder.handlerRemoved0.

Gets called after the ByteToMessageDecoder was removed from the actual context and it doesn't handle events anymore.

Annotations
@Override