public class ZstdDecompressCtx
extends java.lang.Object
| Constructor and Description |
|---|
ZstdDecompressCtx()
Create a context for faster compress operations
One such context is required for each thread - put this in a ThreadLocal.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
decompress(byte[] dst,
byte[] src) |
byte[] |
decompress(byte[] src,
int originalSize) |
int |
decompress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf)
Decompresses buffer 'srcBuff' into buffer 'dstBuff' using this ZstdDecompressCtx.
|
java.nio.ByteBuffer |
decompress(java.nio.ByteBuffer srcBuf,
int originalSize) |
int |
decompressByteArray(byte[] dstBuff,
int dstOffset,
int dstSize,
byte[] srcBuff,
int srcOffset,
int srcSize)
Decompresses byte array 'srcBuff' into byte array 'dstBuff' using this ZstdDecompressCtx.
|
int |
decompressDirectByteBuffer(java.nio.ByteBuffer dstBuff,
int dstOffset,
int dstSize,
java.nio.ByteBuffer srcBuff,
int srcOffset,
int srcSize)
Decompresses buffer 'srcBuff' into buffer 'dstBuff' using this ZstdDecompressCtx.
|
protected void |
finalize() |
ZstdDecompressCtx |
loadDict(byte[] dict)
Load decompression dictionary.
|
ZstdDecompressCtx |
loadDict(ZstdDictDecompress dict)
Load decompression dictionary
|
void |
setFinalize(boolean finalize)
Enable or disable class finalizers
If finalizers are disabled the responsibility fir calling the `close` method is on the consumer.
|
public ZstdDecompressCtx()
public ZstdDecompressCtx loadDict(ZstdDictDecompress dict)
dict - the dictionary or `null` to remove loaded dictionarypublic ZstdDecompressCtx loadDict(byte[] dict)
dict - the dictionary or `null` to remove loaded dictionarypublic int decompressDirectByteBuffer(java.nio.ByteBuffer dstBuff,
int dstOffset,
int dstSize,
java.nio.ByteBuffer srcBuff,
int srcOffset,
int srcSize)
dstBuff - the destination buffer - must be directdstOffset - the start offset of 'dstBuff'dstSize - the size of 'dstBuff'srcBuff - the source buffer - must be directsrcOffset - the start offset of 'srcBuff'srcSize - the size of 'srcBuff'public int decompressByteArray(byte[] dstBuff,
int dstOffset,
int dstSize,
byte[] srcBuff,
int srcOffset,
int srcSize)
dstBuff - the destination bufferdstOffset - the start offset of 'dstBuff'dstSize - the size of 'dstBuff'srcBuff - the source buffersrcOffset - the start offset of 'srcBuff'srcSize - the size of 'srcBuff'public int decompress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf)
throws ZstdException
dstBuf - the destination buffer - must be direct. It is assumed that the `position()` of this buffer marks the offset
at which the decompressed data are to be written, and that the `limit()` of this buffer is the maximum
decompressed data size to allow.
When this method returns successfully, its `position()` will be set to its current `position()` plus the decompressed size of the data.
srcBuf - the source buffer - must be direct. It is assumed that the `position()` of this buffer marks the beginning of the
compressed data to be decompressed, and that the `limit()` of this buffer marks its end.
When this method returns successfully, its `position()` will be set to the initial `limit()`.
ZstdExceptionpublic java.nio.ByteBuffer decompress(java.nio.ByteBuffer srcBuf,
int originalSize)
throws ZstdException
ZstdExceptionpublic int decompress(byte[] dst,
byte[] src)
public byte[] decompress(byte[] src,
int originalSize)
throws ZstdException
ZstdExceptionpublic void setFinalize(boolean finalize)
finalize, - default `true` - finalizers are enabledpublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableprotected void finalize()
finalize in class java.lang.Object