Class ZstdDecompressor
- java.lang.Object
-
- io.netty.handler.codec.compression.ZstdDecompressor
-
- All Implemented Interfaces:
Decompressor,java.lang.AutoCloseable
@UnstableApi public final class ZstdDecompressor extends java.lang.Object implements Decompressor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classZstdDecompressor.Builderprivate static classZstdDecompressor.MutableByteBufInputStream-
Nested classes/interfaces inherited from interface io.netty.handler.codec.compression.Decompressor
Decompressor.AbstractDecompressorBuilder, Decompressor.Status
-
-
Field Summary
Fields Modifier and Type Field Description private ByteBufAllocatorallocatorprivate static intDEFAULT_MAX_FORWARD_BYTESstatic intDEFAULT_MAX_WINDOW_LOGDefault upper bound on theWindow_Logaccepted by the decompressor.private static intMAX_WINDOW_LOGprivate static intMIN_WINDOW_LOGprivate ZstdDecompressor.MutableByteBufInputStreammutableInputprivate com.github.luben.zstd.ZstdInputStreamNoFinalizeroutput
-
Constructor Summary
Constructors Constructor Description ZstdDecompressor(ZstdDecompressor.Builder builder, ByteBufAllocator allocator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInput(ByteBuf buf)Add a new input buffer.static ZstdDecompressor.Builderbuilder()voidclose()Close this decompressor, cleaning up any associated resources.voidendOfInput()Notify the decompressor that the end of input has been reached.Decompressor.Statusstatus()Get the current status.ByteBuftakeOutput()Take a decompressed buffer from this decompressor.
-
-
-
Field Detail
-
DEFAULT_MAX_WINDOW_LOG
public static final int DEFAULT_MAX_WINDOW_LOG
Default upper bound on theWindow_Logaccepted by the decompressor.27corresponds to a 128 MiB decompression window.- See Also:
- Constant Field Values
-
MIN_WINDOW_LOG
private static final int MIN_WINDOW_LOG
- See Also:
- Constant Field Values
-
MAX_WINDOW_LOG
private static final int MAX_WINDOW_LOG
- See Also:
- Constant Field Values
-
DEFAULT_MAX_FORWARD_BYTES
private static final int DEFAULT_MAX_FORWARD_BYTES
-
allocator
private final ByteBufAllocator allocator
-
mutableInput
private final ZstdDecompressor.MutableByteBufInputStream mutableInput
-
output
private final com.github.luben.zstd.ZstdInputStreamNoFinalizer output
-
-
Constructor Detail
-
ZstdDecompressor
ZstdDecompressor(ZstdDecompressor.Builder builder, ByteBufAllocator allocator)
-
-
Method Detail
-
status
public Decompressor.Status status() throws DecompressionException
Description copied from interface:DecompressorGet the current status. Like the other operations on this class, calling this method is not permitted if the decompressor has failed or was closed.- Specified by:
statusin interfaceDecompressor- Returns:
- The current status
- Throws:
DecompressionException
-
addInput
public void addInput(ByteBuf buf) throws DecompressionException
Description copied from interface:DecompressorAdd a new input buffer. Only permitted forDecompressor.Status.NEED_INPUT.- Specified by:
addInputin interfaceDecompressor- Parameters:
buf- The input buffer. Buffer ownership transfers to the decompressor (also on exception).- Throws:
DecompressionException
-
endOfInput
public void endOfInput() throws DecompressionExceptionDescription copied from interface:DecompressorNotify the decompressor that the end of input has been reached. Some implementations may flush remaining data or throw an exception if the input is truncated, but most implementations do nothing. Only permitted forDecompressor.Status.NEED_INPUT.- Specified by:
endOfInputin interfaceDecompressor- Throws:
DecompressionException
-
takeOutput
public ByteBuf takeOutput() throws DecompressionException
Description copied from interface:DecompressorTake a decompressed buffer from this decompressor. Only permitted forDecompressor.Status.NEED_OUTPUT. Buffer ownership transfers to the caller.- Specified by:
takeOutputin interfaceDecompressor- Returns:
- The decompressed buffer. May be empty.
- Throws:
DecompressionException
-
close
public void close()
Description copied from interface:DecompressorClose this decompressor, cleaning up any associated resources. This method is idempotent.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceDecompressor
-
builder
@UnstableApi public static ZstdDecompressor.Builder builder()
-
-