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

public Interface Decompressor

extends AutoCloseable
Known Direct Implementers
io.netty5.handler.codec.compression.FastLzDecompressor, io.netty5.handler.codec.compression.Lz4Decompressor, io.netty5.handler.codec.compression.LzfDecompressor, io.netty5.handler.codec.compression.SnappyDecompressor, io.netty5.handler.codec.compression.ZlibDecompressor, io.netty5.handler.codec.compression.BrotliDecompressor, io.netty5.handler.codec.compression.Bzip2Decompressor
Imports
io.netty5.buffer.Buffer, .BufferAllocator

Decompressor that takes care of decompress some input.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.lang.AutoCloseable.close.

Close the decompressor.
public Buffer

Returns:

the Buffer that contains the decompressed data. The caller of this method takes ownership of the buffer. The return value will be null if there is not enough data readable in the input to make any progress. In this case the user should call it again once there is more data ready to be consumed.
decompress
(Buffer
the Buffer that contains the data to be decompressed.
input
,
BufferAllocator
the BufferAllocator that is used to allocate a new buffer (if needed) to write the decompressed bytes too.
allocator
)

This method will read from the input Buffer and decompress into a new Buffer that will be allocated (if needed) from the BufferAllocator.

public boolean

Returns:

if close() was called.
isClosed
()

Return true if the decompressor was closed, false otherwise.

public boolean

Returns:

true if the decompressor is done with decompressing the stream.
isFinished
()

Returns true if the decompressor was finish.

Method Detail

closeback to summary
public void close()

Redeclares java.lang.AutoCloseable.close.

Close the decompressor. After this method was called isFinished() will return true as well and it is not allowed to call decompress(Buffer, BufferAllocator) anymore.

Annotations
@Override
decompressback to summary
public Buffer decompress(Buffer input, BufferAllocator allocator) throws DecompressionException

This method will read from the input Buffer and decompress into a new Buffer that will be allocated (if needed) from the BufferAllocator. If there is not enough readable data in the Buffer to process it will return null. This method should be called in a loop as long:

    • something was read from the input
      something was returned
  • Otherwise this method should be called again once there is more data in the input buffer.
    Parameters
    input:Buffer

    the Buffer that contains the data to be decompressed.

    allocator:BufferAllocator

    the BufferAllocator that is used to allocate a new buffer (if needed) to write the decompressed bytes too.

    Returns:Buffer

    the Buffer that contains the decompressed data. The caller of this method takes ownership of the buffer. The return value will be null if there is not enough data readable in the input to make any progress. In this case the user should call it again once there is more data ready to be consumed.

    Exceptions
    DecompressionException:
    thrown if an decompression error was encountered or the decompressor was closed before.
    isClosedback to summary
    public boolean isClosed()

    Return true if the decompressor was closed, false otherwise.

    Returns:boolean

    if close() was called.

    isFinishedback to summary
    public boolean isFinished()

    Returns true if the decompressor was finish. This might be because the decompressor was explicitly closed or the end of the compressed stream was detected.

    Returns:boolean

    true if the decompressor is done with decompressing the stream.