| Modifier and Type | Field and Description |
|---|---|
| private ZstdDictCompress | |
| private long | |
| private SequenceProducer | |
| private long |
| Access | Constructor and Description |
|---|---|
| public | ZstdCompressCtx()
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 |
|---|---|
| public int | Returns: the size of the compressed datathe destination buffer - must be direct. It is assumed that the `position()` of this buffer marks the offset
at which the compressed data are to be written, and that the `limit()` of this buffer is the maximum
compressed data size to allow.
dstBuf, ByteBuffer When this method returns successfully, its `position()` will be set to its current `position()` plus the compressed size of the data. the source buffer - must be direct. It is assumed that the `position()` of this buffer marks the beginning of the
uncompressed data to be compressed, and that the `limit()` of this buffer marks its end.
srcBuf)When this method returns successfully, its `position()` will be set to the initial `limit()`. Compresses the data in buffer 'srcBuf' |
| public ByteBuffer | Returns: A newly allocated direct ByteBuffer containing the compressed data.the source buffer - must be direct. It is assumed that the `position()` of the
buffer marks the beginning of the uncompressed data to be compressed, and that
the `limit()` of this buffer marks its end.
srcBuf)When this method returns successfully, its `position()` will be set to its initial `limit()`. Compresses the data in buffer 'srcBuf' |
| public int | |
| public byte[] | |
| public int | Returns: the number of bytes written into buffer 'dstBuff'.the destination buffer (byte array) dstBuff, int the start offset of 'dstBuff' dstOffset, int the size of 'dstBuff' (after 'dstOffset') dstSize, byte[] the source buffer (byte array) srcBuff, int the start offset of 'srcBuff' srcOffset, int the length of 'srcBuff' (after 'srcOffset') srcSize)Compresses byte array 'srcBuff' into byte array 'dstBuff' reusing this ZstdCompressCtx. |
| private static native long | compressByteArray0(long ptr, byte[] dst, int dstOffset, int dstSize, byte[] src, int srcOffset, int srcSize)
|
| public int | Returns: the number of bytes written into buffer 'dstBuff'.the destination buffer - must be direct dstBuff, int the start offset of 'dstBuff' dstOffset, int the size of 'dstBuff' (after 'dstOffset') dstSize, ByteBuffer the source buffer - must be direct srcBuff, int the start offset of 'srcBuff' srcOffset, int the length of 'srcBuff' (after 'srcOffset') srcSize)Compresses buffer 'srcBuff' into buffer 'dstBuff' reusing this ZstdCompressCtx. |
| private static native long | compressDirectByteBuffer0(long ptr, ByteBuffer dst, int dstOffset, int dstSize, ByteBuffer src, int srcOffset, int srcSize)
|
| public boolean | Returns: true if all state has been flushed from internal buffersdestination of compressed data dst, ByteBuffer buffer to compress src, EndDirective directive for handling the end of the stream endOp)Compress as much of the |
| private static native long | compressDirectByteBufferStream0(long ptr, ByteBuffer dst, int dstOffset, int dstSize, ByteBuffer src, int srcSize, int srcOffset, int endOp)
4 pieces of information are packed into the return value of this method, which must be treated as an unsigned long. |
| pack-priv void | |
| private void | |
| private static native void | |
| public ZstdFrameProgression | getFrameProgression()
Tells how much data has been ingested (read from input), consumed (input actually compressed) and produced (output) for current frame. |
| private static native ZstdFrameProgression | |
| pack-priv long | |
| private static native long | |
| private native long | |
| private native long | |
| public ZstdCompressCtx | loadDict(ZstdDictCompress
the dictionary or `null` to remove loaded dictionary dict)Load compression dictionary to be used for subsequently compressed frames. |
| public ZstdCompressCtx | loadDict(byte[]
the dictionary or `null` to remove loaded dictionary dict)Load compression dictionary to be used for subsequently compressed frames. |
| public ZstdCompressCtx | registerSequenceProducer(SequenceProducer
the user-defined producer)SequenceProducer to register.Register an external sequence producer |
| public void | |
| private static native long | |
| public ZstdCompressCtx | |
| public ZstdCompressCtx | setChecksum(boolean
A 32-bits checksum of content is written at end of frame, default: false checksumFlag)Enable or disable compression checksums |
| private static native void | |
| public ZstdCompressCtx | setContentSize(boolean
Content size will be written into frame header _whenever known_, default: true contentSizeFlag)Enable or disable content size |
| private static native void | |
| public ZstdCompressCtx | setDictID(boolean
When applicable, dictionary's ID is written into frame header, default: true dictIDFlag)Enable or disable dictID |
| private static native void | |
| public ZstdCompressCtx | setEnableLongDistanceMatching(Zstd.
whether to enable long-distance matching. enableLDMEnable or disable long-distance matching. |
| public ZstdCompressCtx | |
| public ZstdCompressCtx | |
| public ZstdCompressCtx | |
| private static native void | |
| public ZstdCompressCtx | setLong(int
Maximum allowed back-reference distance, expressed as power of 2.
This will set a memory budget for streaming decompression,
with larger values requiring more memory and typically compressing more.
Must be clamped between 10 and 32/64 but values greater than 27 may not
be decompressable in all context as they require more memory.
0 disables LDM. windowLog)Enable or disable LongDistanceMatching and set the window size |
| public ZstdCompressCtx | setMagicless(boolean
A 32-bits magic number is written at start of frame, default: false magiclessFlag)Enable or disable magicless frames |
| public ZstdCompressCtx | |
| public ZstdCompressCtx | |
| public void | |
| private static native long | |
| public ZstdCompressCtx | setSearchForExternalRepcodes(Zstd.
whether to search for repcodes searchRepcodesSet whether to search external sequences for repeated offsets that can be encoded as repcodes. |
| public ZstdCompressCtx | |
| public ZstdCompressCtx | setSequenceProducerFallback(boolean
fall back to the default internal sequence producer if an external
sequence producer returns an error code, default: false fallbackFlag)Enable or disable sequence producer fallback |
| public ZstdCompressCtx | |
| public ZstdCompressCtx | |
| public ZstdCompressCtx | setValidateSequences(Zstd.
whether to enable sequence validation validateSequencesEnable or disable sequence validation. |
| public ZstdCompressCtx | |
| public ZstdCompressCtx |
| compression_dict | back to summary |
|---|---|
| private ZstdDictCompress compression_dict | |
| nativePtr | back to summary |
|---|---|
| private long nativePtr | |
| seqprod | back to summary |
|---|---|
| private SequenceProducer seqprod | |
| seqprod_state | back to summary |
|---|---|
| private long seqprod_state | |
| ZstdCompressCtx | back to summary |
|---|---|
| public ZstdCompressCtx() Create a context for faster compress operations One such context is required for each thread - put this in a ThreadLocal. | |
| compress | back to summary |
|---|---|
| public int compress(ByteBuffer dstBuf, ByteBuffer srcBuf) Compresses the data in buffer 'srcBuf'
| |
| compress | back to summary |
|---|---|
| public ByteBuffer compress(ByteBuffer srcBuf) throws ZstdException Compresses the data in buffer 'srcBuf'
| |
| compress | back to summary |
|---|---|
| public int compress(byte[] dst, byte[] src) | |
| compress | back to summary |
|---|---|
| public byte[] compress(byte[] src) | |
| compressByteArray | back to summary |
|---|---|
| public int compressByteArray(byte[] dstBuff, int dstOffset, int dstSize, byte[] srcBuff, int srcOffset, int srcSize) Compresses byte array 'srcBuff' into byte array 'dstBuff' reusing this ZstdCompressCtx. Destination buffer should be sized to handle worst cases situations (input data not compressible). Worst case size evaluation is provided by function ZSTD_compressBound().
| |
| compressByteArray0 | back to summary |
|---|---|
| private static native long compressByteArray0(long ptr, byte[] dst, int dstOffset, int dstSize, byte[] src, int srcOffset, int srcSize) | |
| compressDirectByteBuffer | back to summary |
|---|---|
| public int compressDirectByteBuffer(ByteBuffer dstBuff, int dstOffset, int dstSize, ByteBuffer srcBuff, int srcOffset, int srcSize) Compresses buffer 'srcBuff' into buffer 'dstBuff' reusing this ZstdCompressCtx. Destination buffer should be sized to handle worst cases situations (input data not compressible). Worst case size evaluation is provided by function ZSTD_compressBound(). This is a low-level function that does not take into account or affect the `limit` or `position` of source or destination buffers.
| |
| compressDirectByteBuffer0 | back to summary |
|---|---|
| private static native long compressDirectByteBuffer0(long ptr, ByteBuffer dst, int dstOffset, int dstSize, ByteBuffer src, int srcOffset, int srcSize) | |
| compressDirectByteBufferStream | back to summary |
|---|---|
| public boolean compressDirectByteBufferStream(ByteBuffer dst, ByteBuffer src, EndDirective endOp) Compress as much of the
| |
| compressDirectByteBufferStream0 | back to summary |
|---|---|
| private static native long compressDirectByteBufferStream0(long ptr, ByteBuffer dst, int dstOffset, int dstSize, ByteBuffer src, int srcSize, int srcOffset, int endOp) 4 pieces of information are packed into the return value of this method, which must be treated as an unsigned long. The highest bit is set if all data has been flushed from internal buffers. The next 31 bits are the new position of the destination buffer. The next bit is set if an error occurred. If an error occurred, the lowest 31 bits encode a zstd error code. Otherwise, the lowest 31 bits are the new position of the source buffer. | |
| doClose | back to summary |
|---|---|
| pack-priv void doClose() Implements abstract com. | |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() | |
| free | back to summary |
|---|---|
| private static native void free(long ptr) | |
| getFrameProgression | back to summary |
|---|---|
| public ZstdFrameProgression getFrameProgression() Tells how much data has been ingested (read from input), consumed (input actually compressed) and produced (output) for current frame. | |
| getFrameProgression0 | back to summary |
|---|---|
| private static native ZstdFrameProgression getFrameProgression0(long ptr) | |
| getNativePtr | back to summary |
|---|---|
| pack-priv long getNativePtr() | |
| init | back to summary |
|---|---|
| private static native long init() | |
| loadCDict0 | back to summary |
|---|---|
| private native long loadCDict0(long ptr, byte[] dict) | |
| loadCDictFast0 | back to summary |
|---|---|
| private native long loadCDictFast0(long ptr, ZstdDictCompress dict) | |
| loadDict | back to summary |
|---|---|
| public ZstdCompressCtx loadDict(ZstdDictCompress dict) Load compression dictionary to be used for subsequently compressed frames.
| |
| loadDict | back to summary |
|---|---|
| public ZstdCompressCtx loadDict(byte[] dict) Load compression dictionary to be used for subsequently compressed frames.
| |
| registerSequenceProducer | back to summary |
|---|---|
| public ZstdCompressCtx registerSequenceProducer(SequenceProducer producer) Register an external sequence producer
| |
| reset | back to summary |
|---|---|
| public void reset() Clear all state and parameters from the compression context. This leaves the object in a state identical to a newly created compression context. | |
| reset0 | back to summary |
|---|---|
| private static native long reset0(long ptr) | |
| setChainLog | back to summary |
|---|---|
| public ZstdCompressCtx setChainLog(int chainLog) | |
| setChecksum | back to summary |
|---|---|
| public ZstdCompressCtx setChecksum(boolean checksumFlag) Enable or disable compression checksums
| |
| setChecksum0 | back to summary |
|---|---|
| private static native void setChecksum0(long ptr, boolean checksumFlag) | |
| setContentSize | back to summary |
|---|---|
| public ZstdCompressCtx setContentSize(boolean contentSizeFlag) Enable or disable content size
| |
| setContentSize0 | back to summary |
|---|---|
| private static native void setContentSize0(long ptr, boolean contentSizeFlag) | |
| setDictID | back to summary |
|---|---|
| public ZstdCompressCtx setDictID(boolean dictIDFlag) Enable or disable dictID
| |
| setDictID0 | back to summary |
|---|---|
| private static native void setDictID0(long ptr, boolean dictIDFlag) | |
| setEnableLongDistanceMatching | back to summary |
|---|---|
| public ZstdCompressCtx setEnableLongDistanceMatching(Zstd. Enable or disable long-distance matching.
| |
| setHashLog | back to summary |
|---|---|
| public ZstdCompressCtx setHashLog(int hashLog) | |
| setJobSize | back to summary |
|---|---|
| public ZstdCompressCtx setJobSize(int jobSize) | |
| setLevel | back to summary |
|---|---|
| public ZstdCompressCtx setLevel(int level) Set compression level
| |
| setLevel0 | back to summary |
|---|---|
| private static native void setLevel0(long ptr, int level) | |
| setLong | back to summary |
|---|---|
| public ZstdCompressCtx setLong(int windowLog) Enable or disable LongDistanceMatching and set the window size
| |
| setMagicless | back to summary |
|---|---|
| public ZstdCompressCtx setMagicless(boolean magiclessFlag) Enable or disable magicless frames
| |
| setMinMatch | back to summary |
|---|---|
| public ZstdCompressCtx setMinMatch(int minMatch) | |
| setOverlapLog | back to summary |
|---|---|
| public ZstdCompressCtx setOverlapLog(int overlapLog) | |
| setPledgedSrcSize | back to summary |
|---|---|
| public void setPledgedSrcSize(long srcSize) Promise to compress a certain number of source bytes. Knowing the number of bytes to compress up front helps to choose proper compression settings and size internal buffers. Additionally, the pledged size is stored in the header of the output stream, allowing decompressors to know how much uncompressed data to expect. Attempting to compress more or less than the pledged size will result in an error. | |
| setPledgedSrcSize0 | back to summary |
|---|---|
| private static native long setPledgedSrcSize0(long ptr, long srcSize) | |
| setSearchForExternalRepcodes | back to summary |
|---|---|
| public ZstdCompressCtx setSearchForExternalRepcodes(Zstd. Set whether to search external sequences for repeated offsets that can be encoded as repcodes.
| |
| setSearchLog | back to summary |
|---|---|
| public ZstdCompressCtx setSearchLog(int searchLog) | |
| setSequenceProducerFallback | back to summary |
|---|---|
| public ZstdCompressCtx setSequenceProducerFallback(boolean fallbackFlag) Enable or disable sequence producer fallback
| |
| setStrategy | back to summary |
|---|---|
| public ZstdCompressCtx setStrategy(int strategy) | |
| setTargetLength | back to summary |
|---|---|
| public ZstdCompressCtx setTargetLength(int targetLength) | |
| setValidateSequences | back to summary |
|---|---|
| public ZstdCompressCtx setValidateSequences(Zstd. Enable or disable sequence validation. Useful for the sequence-level API and with external sequence producers.
| |
| setWindowLog | back to summary |
|---|---|
| public ZstdCompressCtx setWindowLog(int windowLog) | |
| setWorkers | back to summary |
|---|---|
| public ZstdCompressCtx setWorkers(int workers) | |