DecompressorZStandardDecompressor.ZStandardDirectDecompressorpublic class ZStandardDecompressor extends java.lang.Object implements Decompressor
Decompressor based on the zStandard compression algorithm.
https://github.com/facebook/zstd| Modifier and Type | Class | Description |
|---|---|---|
static class |
ZStandardDecompressor.ZStandardDirectDecompressor |
A
DirectDecompressor for ZStandard
https://github.com/facebook/zstd. |
| Constructor | Description |
|---|---|
ZStandardDecompressor() |
|
ZStandardDecompressor(int bufferSize) |
Creates a new decompressor.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
decompress(byte[] b,
int off,
int len) |
Fills specified buffer with uncompressed data.
|
void |
end() |
Closes the decompressor and discards any unprocessed input.
|
protected void |
finalize() |
|
boolean |
finished() |
Returns
true if the end of the decompressed
data output stream has been reached. |
static int |
getRecommendedBufferSize() |
|
int |
getRemaining() |
Returns the number of bytes remaining in the input buffers;
normally called when finished() is true to determine amount of post-stream
data.
|
static boolean |
isNativeCodeLoaded() |
|
boolean |
needsDictionary() |
Returns
true if a preset dictionary is needed for decompression. |
boolean |
needsInput() |
Returns
true if the input data buffer is empty and
Decompressor.setInput(byte[], int, int) should be called to
provide more input. |
void |
reset() |
Resets everything including the input buffers (user and direct).
|
void |
setDictionary(byte[] b,
int off,
int len) |
Sets preset dictionary for compression.
|
void |
setInput(byte[] b,
int off,
int len) |
Sets input data for decompression.
|
public ZStandardDecompressor()
public ZStandardDecompressor(int bufferSize)
bufferSize - bufferSize.public static boolean isNativeCodeLoaded()
public static int getRecommendedBufferSize()
public void setInput(byte[] b,
int off,
int len)
DecompressorDecompressor.needsInput() returns
true indicating that more input data is required.
(Both native and non-native versions of various Decompressors require
that the data passed in via b[] remain unmodified until
the caller is explicitly notified--via Decompressor.needsInput()--that the
buffer may be safely modified. With this requirement, an extra
buffer-copy can be avoided.)setInput in interface Decompressorb - Input dataoff - Start offsetlen - Lengthpublic void setDictionary(byte[] b,
int off,
int len)
DecompressorsetDictionary in interface Decompressorb - Dictionary data bytesoff - Start offsetlen - Lengthpublic boolean needsInput()
Decompressortrue if the input data buffer is empty and
Decompressor.setInput(byte[], int, int) should be called to
provide more input.needsInput in interface Decompressortrue if the input data buffer is empty and
Decompressor.setInput(byte[], int, int) should be called in
order to provide more input.public boolean needsDictionary()
Decompressortrue if a preset dictionary is needed for decompression.needsDictionary in interface Decompressortrue if a preset dictionary is needed for decompressionpublic boolean finished()
Decompressortrue if the end of the decompressed
data output stream has been reached. Indicates a concatenated data stream
when finished() returns true and Decompressor.getRemaining()
returns a positive value. finished() will be reset with the
Decompressor.reset() method.finished in interface Decompressortrue if the end of the decompressed
data output stream has been reached.public int decompress(byte[] b,
int off,
int len)
throws java.io.IOException
DecompressorDecompressor.needsInput() should be called in order to determine if more
input data is required.decompress in interface Decompressorb - Buffer for the uncompressed dataoff - Start offset of the datalen - Size of the bufferjava.io.IOException - raised on errors performing I/O.public int getRemaining()
Returns the number of bytes remaining in the input buffers; normally called when finished() is true to determine amount of post-stream data.
getRemaining in interface Decompressorpublic void reset()
reset in interface Decompressorpublic void end()
Decompressorend in interface Decompressorprotected void finalize()
finalize in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.