public class Zstd
extends java.lang.Object
| Constructor and Description |
|---|
Zstd() |
| Modifier and Type | Method and Description |
|---|---|
static int |
blockSizeMax() |
static int |
chainLogMax() |
static int |
chainLogMin() |
static byte[] |
compress(byte[] src)
Compresses the data in buffer 'src' using defaul compression level
|
static long |
compress(byte[] dst,
byte[] src,
byte[] dict,
int level)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
compress(byte[] dst,
byte[] src,
int level)
Compresses buffer 'src' into buffer 'dst'.
|
static long |
compress(byte[] dst,
byte[] src,
int level,
boolean checksumFlag)
Compresses buffer 'src' into buffer 'dst'.
|
static long |
compress(byte[] dst,
byte[] src,
ZstdDictCompress dict) |
static byte[] |
compress(byte[] src,
int level)
Compresses the data in buffer 'src'
|
static byte[] |
compress(byte[] src,
ZstdDictCompress dict)
Compresses the data in buffer 'src'
|
static java.nio.ByteBuffer |
compress(java.nio.ByteBuffer srcBuff,
byte[] dict,
int level)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static int |
compress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf)
Compresses the data in buffer 'srcBuf' using default compression level
|
static int |
compress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
byte[] dict,
int level)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static int |
compress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf,
int level) |
static int |
compress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf,
int level,
boolean checksumFlag)
Compresses the data in buffer 'srcBuf'
|
static int |
compress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
ZstdDictCompress dict)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static java.nio.ByteBuffer |
compress(java.nio.ByteBuffer srcBuf,
int level)
Compresses the data in buffer 'srcBuf'
|
static java.nio.ByteBuffer |
compress(java.nio.ByteBuffer srcBuff,
ZstdDictCompress dict)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
compressBound(long srcSize)
Maximum size of the compressed data
|
static long |
compressByteArray(byte[] dst,
int dstOffset,
int dstSize,
byte[] src,
int srcOffset,
int srcSize,
int level)
Compresses buffer 'src' into buffer 'dst'.
|
static long |
compressByteArray(byte[] dst,
int dstOffset,
int dstSize,
byte[] src,
int srcOffset,
int srcSize,
int level,
boolean checksumFlag)
Compresses buffer 'src' into buffer 'dst'.
|
static long |
compressDirectByteBuffer(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
int level)
Compresses direct buffer 'src' into direct buffer 'dst'.
|
static long |
compressDirectByteBuffer(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
int level,
boolean checksumFlag)
Compresses direct buffer 'src' into direct buffer 'dst'.
|
static long |
compressDirectByteBufferFastDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
ZstdDictCompress dict)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
compressDirectByteBufferUsingDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
byte[] dict,
int level)
Compresses direct byte buffer 'src' into direct byte buffer 'dst' with dictionary.
|
static long |
compressFastDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
ZstdDictCompress dict)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
compressFastDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
ZstdDictCompress dict)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
compressUnsafe(long dst,
long dstSize,
long src,
long srcSize,
int level)
Compresses buffer 'src' into direct buffer 'dst'.
|
static long |
compressUnsafe(long dst,
long dstSize,
long src,
long srcSize,
int level,
boolean checksumFlag)
Compresses buffer 'src' into direct buffer 'dst'.
|
static long |
compressUsingDict(byte[] dst,
byte[] src,
byte[] dict,
int level)
Deprecated.
Use compress(dst, src, dict, level) instead
|
static byte[] |
compressUsingDict(byte[] src,
byte[] dict,
int level)
Compresses buffer 'src' with dictionary.
|
static long |
compressUsingDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
byte[] dict,
int level)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
compressUsingDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
byte[] dict,
int level)
Compresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
decompress(byte[] dst,
byte[] src)
Decompresses buffer 'src' into buffer 'dst'.
|
static long |
decompress(byte[] dst,
byte[] src,
byte[] dict)
Decompresses buffer 'src' into buffer 'dst' with dictionary.
|
static byte[] |
decompress(byte[] src,
byte[] dict,
int originalSize) |
static byte[] |
decompress(byte[] src,
int originalSize)
Decompress data
|
static byte[] |
decompress(byte[] src,
ZstdDictDecompress dict,
int originalSize)
Decompress data
|
static java.nio.ByteBuffer |
decompress(java.nio.ByteBuffer srcBuff,
byte[] dict,
int originalSize)
Decompress data
|
static int |
decompress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf)
Decompress data
|
static int |
decompress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
byte[] dict)
Decompress data
|
static int |
decompress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
ZstdDictDecompress dict)
Decompress data
|
static java.nio.ByteBuffer |
decompress(java.nio.ByteBuffer srcBuf,
int originalSize)
Decompress data
|
static java.nio.ByteBuffer |
decompress(java.nio.ByteBuffer srcBuff,
ZstdDictDecompress dict,
int originalSize)
Decompress data
|
static long |
decompressByteArray(byte[] dst,
int dstOffset,
int dstSize,
byte[] src,
int srcOffset,
int srcSize)
Decompresses buffer 'src' into buffer 'dst'.
|
static long |
decompressDirectByteBuffer(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize)
Decompresses direct buffer 'src' into direct buffer 'dst'.
|
static long |
decompressDirectByteBufferFastDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
ZstdDictDecompress dict)
Decompresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
decompressDirectByteBufferUsingDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
byte[] dict)
Decompresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
decompressedDirectByteBufferSize(java.nio.ByteBuffer src,
int srcPosition,
int srcSize)
Return the original size of a compressed buffer (if known)
|
static long |
decompressedSize(byte[] src)
Return the original size of a compressed buffer (if known)
|
static long |
decompressedSize(byte[] src,
int srcPosition)
Return the original size of a compressed buffer (if known)
|
static long |
decompressedSize(byte[] src,
int srcPosition,
int srcSize)
Return the original size of a compressed buffer (if known)
|
static long |
decompressedSize(java.nio.ByteBuffer srcBuf)
Return the original size of a compressed buffer (if known)
|
static long |
decompressFastDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
ZstdDictDecompress dict)
Decompresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
decompressUnsafe(long dst,
long dstSize,
long src,
long srcSize)
Decompresses buffer 'src' into direct buffer 'dst'.
|
static long |
decompressUsingDict(byte[] dst,
byte[] src,
byte[] dict)
Deprecated.
Use decompress(dst, src, dict) instead
|
static long |
decompressUsingDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
byte[] dict)
Decompresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
errChecksumWrong() |
static long |
errCorruptionDetected() |
static long |
errDictionaryCorrupted() |
static long |
errDictionaryCreationFailed() |
static long |
errDictionaryWrong() |
static long |
errDstBufferNull() |
static long |
errDstSizeTooSmall() |
static long |
errFrameParameterUnsupported() |
static long |
errFrameParameterWindowTooLarge() |
static long |
errGeneric() |
static long |
errInitMissing() |
static long |
errMaxSymbolValueTooLarge() |
static long |
errMaxSymbolValueTooSmall() |
static long |
errMemoryAllocation() |
static long |
errNoError() |
static long |
errParameterOutOfBound() |
static long |
errParameterUnsupported() |
static long |
errPrefixUnknown() |
static long |
errSrcSizeWrong() |
static long |
errStageWrong() |
static long |
errTableLogTooLarge() |
static long |
errVersionUnsupported() |
static long |
errWorkSpaceTooSmall() |
static int |
frameHeaderSizeMax() |
static int |
frameHeaderSizeMin() |
static long |
getDictIdFromDict(byte[] dict)
Get DictId of a dictionary
|
static long |
getDictIdFromFrame(byte[] src)
Get DictId from a compressed frame
|
static long |
getDictIdFromFrameBuffer(java.nio.ByteBuffer src)
Get DictId from a compressed ByteBuffer frame
|
static long |
getErrorCode(long code) |
static java.lang.String |
getErrorName(long code) |
static int |
hashLogMax() |
static int |
hashLogMin() |
static boolean |
isError(long code)
Error handling
|
static int |
loadDictCompress(long stream,
byte[] dict,
int dict_size) |
static int |
loadDictDecompress(long stream,
byte[] dict,
int dict_size) |
static int |
loadFastDictCompress(long stream,
ZstdDictCompress dict) |
static int |
loadFastDictDecompress(long stream,
ZstdDictDecompress dict) |
static int |
magicNumber() |
static int |
maxCompressionLevel() |
static int |
minCompressionLevel() |
static int |
searchLengthMax() |
static int |
searchLengthMin() |
static int |
searchLogMax() |
static int |
searchLogMin() |
static int |
setCompressionChecksums(long stream,
boolean useChecksums) |
static int |
setCompressionLevel(long stream,
int level) |
static int |
setCompressionLong(long stream,
int windowLog) |
static int |
setCompressionWorkers(long stream,
int workers) |
static long |
trainFromBuffer(byte[][] samples,
byte[] dictBuffer)
Creates a new dictionary to tune a kind of samples (uses Cover algorithm)
|
static long |
trainFromBuffer(byte[][] samples,
byte[] dictBuffer,
boolean legacy)
Creates a new dictionary to tune a kind of samples
|
static long |
trainFromBufferDirect(java.nio.ByteBuffer samples,
int[] sampleSizes,
java.nio.ByteBuffer dictBuffer)
Creates a new dictionary to tune a kind of samples (uses Cover algorithm)
|
static long |
trainFromBufferDirect(java.nio.ByteBuffer samples,
int[] sampleSizes,
java.nio.ByteBuffer dictBuffer,
boolean legacy)
Creates a new dictionary to tune a kind of samples
|
static int |
windowLogMax() |
static int |
windowLogMin() |
public static long compress(byte[] dst,
byte[] src,
int level,
boolean checksumFlag)
dst - the destination buffersrc - the source bufferlevel - compression levelchecksumFlag - flag to enable or disable checksumpublic static long compress(byte[] dst,
byte[] src,
int level)
dst - the destination buffersrc - the source bufferlevel - compression levelpublic static long compressByteArray(byte[] dst,
int dstOffset,
int dstSize,
byte[] src,
int srcOffset,
int srcSize,
int level,
boolean checksumFlag)
dst - the destination bufferdstOffset - offset from the start of the destination bufferdstSize - available space in the destination buffer after the offsetsrc - the source buffersrcOffset - offset from the start of the source buffersrcSize - available data in the source buffer after the offsetlevel - compression levelchecksumFlag - flag to enable or disable checksumpublic static long compressByteArray(byte[] dst,
int dstOffset,
int dstSize,
byte[] src,
int srcOffset,
int srcSize,
int level)
dst - the destination bufferdstOffset - offset from the start of the destination bufferdstSize - available space in the destination buffer after the offsetsrc - the source buffersrcOffset - offset from the start of the source buffersrcSize - available data in the source buffer after the offsetlevel - compression levelpublic static long compressDirectByteBuffer(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
int level,
boolean checksumFlag)
dst - the destination bufferdstOffset - offset from the start of the destination bufferdstSize - available space in the destination buffer after the offsetsrc - the source buffersrcOffset - offset from the start of the source buffersrcSize - available data in the source buffer after the offsetlevel - compression levelchecksumFlag - flag to enable or disable checksumpublic static long compressDirectByteBuffer(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
int level)
dst - the destination bufferdstOffset - offset from the start of the destination bufferdstSize - available space in the destination buffer after the offsetsrc - the source buffersrcOffset - offset from the start of the source buffersrcSize - available data in the source buffer after the offsetlevel - compression levelpublic static long compressUnsafe(long dst,
long dstSize,
long src,
long srcSize,
int level,
boolean checksumFlag)
dst - pointer to the destination bufferdstSize - available space in the destination buffersrc - pointer to the source buffersrcSize - available data in the source bufferlevel - compression levelchecksumFlag - flag to enable or disable checksumpublic static long compressUnsafe(long dst,
long dstSize,
long src,
long srcSize,
int level)
dst - pointer to the destination bufferdstSize - available space in the destination buffersrc - pointer to the source buffersrcSize - available data in the source bufferlevel - compression levelpublic static long compressUsingDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
byte[] dict,
int level)
dst - the destination bufferdstOffset - the start offset of 'dst'src - the source buffersrcOffset - the start offset of 'src'length - the length of available data in 'src' after `srcOffset'dict - the dictionary bufferlevel - compression levelpublic static long compressUsingDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
byte[] dict,
int level)
dst - the destination bufferdstOffset - the start offset of 'dst'src - the source buffersrcOffset - the start offset of 'src'dict - the dictionary bufferlevel - compression levelpublic static long compressDirectByteBufferUsingDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
byte[] dict,
int level)
dst - the destination bufferdstOffset - the start offset of 'dst'dstSize - size of 'dst'src - the source buffersrcOffset - the start offset of 'src'srcSize - the length of 'src'dict - the dictionary bufferlevel - compression levelpublic static long compressFastDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
ZstdDictCompress dict)
dst - the destination bufferdstOffset - the start offset of 'dst'src - the source buffersrcOffset - the start offset of 'src'length - the length of available data in 'src' after `srcOffset'dict - the dictionarypublic static long compressFastDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
ZstdDictCompress dict)
dst - the destination bufferdstOffset - the start offset of 'dst'src - the source buffersrcOffset - the start offset of 'src'dict - the dictionarypublic static long compress(byte[] dst,
byte[] src,
ZstdDictCompress dict)
public static long compressDirectByteBufferFastDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
ZstdDictCompress dict)
dst - the destination bufferdstOffset - the start offset of 'dst'dstSize - the size of 'dst'src - the source buffersrcOffset - the start offset of 'src'srcSize - the length of 'src'dict - the dictionarypublic static long decompress(byte[] dst,
byte[] src)
dst - the destination buffersrc - the source bufferpublic static long decompressByteArray(byte[] dst,
int dstOffset,
int dstSize,
byte[] src,
int srcOffset,
int srcSize)
dst - the destination bufferdstOffset - offset from the start of the destination bufferdstSize - available space in the destination buffer after the offsetsrc - the source buffersrcOffset - offset from the start of the source buffersrcSize - available data in the source buffer after the offsetpublic static long decompressDirectByteBuffer(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize)
dst - the destination bufferdstOffset - offset from the start of the destination bufferdstSize - available space in the destination buffer after the offsetsrc - the source buffersrcOffset - offset from the start of the source buffersrcSize - available data in the source buffer after the offsetpublic static long decompressUnsafe(long dst,
long dstSize,
long src,
long srcSize)
dst - pointer to the destination bufferdstSize - available space in the destination buffer after the offsetsrc - pointer the source buffersrcSize - available data in the source buffer after the offsetpublic static long decompressUsingDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
byte[] dict)
dst - the destination bufferdstOffset - the start offset of 'dst'src - the source buffersrcOffset - the start offset of 'src'length - the length of 'src'dict - the dictionary bufferpublic static long decompressDirectByteBufferUsingDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
byte[] dict)
dst - the destination bufferdstOffset - the start offset of 'dst'dstSize - size of 'dst'src - the source buffersrcOffset - the start offset of 'src'srcSize - the size of 'src'dict - the dictionary bufferpublic static long decompressFastDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
ZstdDictDecompress dict)
dst - the destination bufferdstOffset - the start offset of 'dst'src - the source buffersrcOffset - the start offset of 'src'length - the length of 'src'dict - the dictionarypublic static long decompressDirectByteBufferFastDict(java.nio.ByteBuffer dst,
int dstOffset,
int dstSize,
java.nio.ByteBuffer src,
int srcOffset,
int srcSize,
ZstdDictDecompress dict)
dst - the destination bufferdstOffset - the start offset of 'dst'dstSize - the size of 'dst'src - the source buffersrcOffset - the start offset of 'src'srcSize - the size of 'src'dict - the dictionarypublic static int loadDictDecompress(long stream,
byte[] dict,
int dict_size)
public static int loadFastDictDecompress(long stream,
ZstdDictDecompress dict)
public static int loadDictCompress(long stream,
byte[] dict,
int dict_size)
public static int loadFastDictCompress(long stream,
ZstdDictCompress dict)
public static int setCompressionChecksums(long stream,
boolean useChecksums)
public static int setCompressionLevel(long stream,
int level)
public static int setCompressionLong(long stream,
int windowLog)
public static int setCompressionWorkers(long stream,
int workers)
public static long decompressedSize(byte[] src,
int srcPosition,
int srcSize)
src - the compressed buffersrcPosition - offset of the compressed data inside the src buffersrcSize - length of the compressed data inside the src bufferpublic static long decompressedSize(byte[] src,
int srcPosition)
src - the compressed buffersrcPosition - offset of the compressed data inside the src bufferpublic static long decompressedSize(byte[] src)
src - the compressed bufferpublic static long decompressedDirectByteBufferSize(java.nio.ByteBuffer src,
int srcPosition,
int srcSize)
src - the compressed buffersrcPosition - offset of the compressed data inside the src buffersrcSize - length of the compressed data inside the src buffepublic static long compressBound(long srcSize)
srcSize - the size of the data to be compressedpublic static boolean isError(long code)
code - return code/sizepublic static java.lang.String getErrorName(long code)
public static long getErrorCode(long code)
public static long errNoError()
public static long errGeneric()
public static long errPrefixUnknown()
public static long errVersionUnsupported()
public static long errFrameParameterUnsupported()
public static long errFrameParameterWindowTooLarge()
public static long errCorruptionDetected()
public static long errChecksumWrong()
public static long errDictionaryCorrupted()
public static long errDictionaryWrong()
public static long errDictionaryCreationFailed()
public static long errParameterUnsupported()
public static long errParameterOutOfBound()
public static long errTableLogTooLarge()
public static long errMaxSymbolValueTooLarge()
public static long errMaxSymbolValueTooSmall()
public static long errStageWrong()
public static long errInitMissing()
public static long errMemoryAllocation()
public static long errWorkSpaceTooSmall()
public static long errDstSizeTooSmall()
public static long errSrcSizeWrong()
public static long errDstBufferNull()
public static long trainFromBuffer(byte[][] samples,
byte[] dictBuffer,
boolean legacy)
samples - the samples buffer arraydictBuffer - the new dictionary bufferlegacy - use the legacy training algorithm; otherwise coverpublic static long trainFromBufferDirect(java.nio.ByteBuffer samples,
int[] sampleSizes,
java.nio.ByteBuffer dictBuffer,
boolean legacy)
samples - the samples direct byte buffer arraysampleSizes - java integer array of sizesdictBuffer - the new dictionary buffer (preallocated direct byte buffer)legacy - use the legacy training algorithm; oterpublic static long getDictIdFromFrame(byte[] src)
src - compressed framepublic static long getDictIdFromFrameBuffer(java.nio.ByteBuffer src)
src - compressed framepublic static long getDictIdFromDict(byte[] dict)
dict - dictionarypublic static long trainFromBuffer(byte[][] samples,
byte[] dictBuffer)
samples - the samples buffer arraydictBuffer - the new dictionary bufferpublic static long trainFromBufferDirect(java.nio.ByteBuffer samples,
int[] sampleSizes,
java.nio.ByteBuffer dictBuffer)
samples - the samples direct byte buffer arraysampleSizes - java integer array of sizesdictBuffer - the new dictionary buffer (preallocated direct byte buffer)public static int magicNumber()
public static int windowLogMin()
public static int windowLogMax()
public static int chainLogMin()
public static int chainLogMax()
public static int hashLogMin()
public static int hashLogMax()
public static int searchLogMin()
public static int searchLogMax()
public static int searchLengthMin()
public static int searchLengthMax()
public static int frameHeaderSizeMin()
public static int frameHeaderSizeMax()
public static int blockSizeMax()
public static int minCompressionLevel()
public static int maxCompressionLevel()
public static byte[] compress(byte[] src)
throws ZstdException
src - the source bufferZstdExceptionpublic static byte[] compress(byte[] src,
int level)
throws ZstdException
src - the source bufferlevel - compression levelZstdExceptionpublic static int compress(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 compressed data are to be written, and that the limit() of this buffer is the maximum
compressed data size to allow.
When this method returns successfully, dstBuf's position() will be set to its current position() plus the compressed 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
uncompressed data to be compressed, and that the limit() of this buffer marks its end.
When this method returns successfully, srcBuf's position() will be set to its limit().
ZstdExceptionpublic static int compress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf,
int level,
boolean checksumFlag)
throws ZstdException
dstBuf - the 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.
When this method returns successfully, dstBuf's position() will be set to its current position() plus the compressed 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
uncompressed data to be compressed, and that the limit() of this buffer marks its end.
When this method returns successfully, srcBuf's position() will be set to its limit().
level - compression levelZstdExceptionpublic static int compress(java.nio.ByteBuffer dstBuf,
java.nio.ByteBuffer srcBuf,
int level)
throws ZstdException
ZstdExceptionpublic static java.nio.ByteBuffer compress(java.nio.ByteBuffer srcBuf,
int level)
throws ZstdException
srcBuf - 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.
When this method returns successfully, srcBuf's position() will be set to its limit().
level - compression levelZstdExceptionpublic static byte[] compress(byte[] src,
ZstdDictCompress dict)
throws ZstdException
src - the source bufferdict - dictionary to useZstdException@Deprecated
public static long compressUsingDict(byte[] dst,
byte[] src,
byte[] dict,
int level)
public static byte[] compressUsingDict(byte[] src,
byte[] dict,
int level)
throws ZstdException
src - the source bufferdict - the dictionary bufferlevel - compression levelZstdExceptionpublic static long compress(byte[] dst,
byte[] src,
byte[] dict,
int level)
dst - the destination buffersrc - the source bufferdict - the dictionary bufferlevel - compression levelpublic static int compress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
byte[] dict,
int level)
throws ZstdException
dstBuff - the destination buffersrcBuff - the source bufferdict - the dictionary bufferlevel - compression levelZstdExceptionpublic static java.nio.ByteBuffer compress(java.nio.ByteBuffer srcBuff,
byte[] dict,
int level)
throws ZstdException
srcBuff - the source bufferdict - the dictionary bufferlevel - compression levelZstdExceptionpublic static int compress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
ZstdDictCompress dict)
throws ZstdException
dstBuff - the destination buffersrcBuff - the source bufferdict - the dictionary bufferZstdExceptionpublic static java.nio.ByteBuffer compress(java.nio.ByteBuffer srcBuff,
ZstdDictCompress dict)
throws ZstdException
srcBuff - the source bufferdict - the dictionary bufferZstdExceptionpublic static byte[] decompress(byte[] src,
int originalSize)
throws ZstdException
src - the source bufferoriginalSize - the maximum size of the uncompressed dataZstdExceptionpublic static 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, dstBuf's 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, srcBuf's position() will be set to its limit().
ZstdExceptionpublic static java.nio.ByteBuffer decompress(java.nio.ByteBuffer srcBuf,
int originalSize)
throws ZstdException
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, srcBuf's position() will be set to its limit().
originalSize - the maximum size of the uncompressed dataZstdExceptionpublic static byte[] decompress(byte[] src,
ZstdDictDecompress dict,
int originalSize)
throws ZstdException
src - the source bufferdict - dictionary to useoriginalSize - the maximum size of the uncompressed dataZstdException@Deprecated
public static long decompressUsingDict(byte[] dst,
byte[] src,
byte[] dict)
public static long decompress(byte[] dst,
byte[] src,
byte[] dict)
dst - the destination buffersrc - the source bufferdict - the dictionary bufferpublic static byte[] decompress(byte[] src,
byte[] dict,
int originalSize)
throws ZstdException
src - the source bufferdict - dictionary to useoriginalSize - the maximum size of the uncompressed dataZstdExceptionpublic static long decompressedSize(java.nio.ByteBuffer srcBuf)
srcBuf - the compressed buffer. must be direct. It is assumed that the position() of this buffer marks the beginning of the
compressed data whose decompressed size is being queried, and that the limit() of this buffer marks its
end.public static int decompress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
byte[] dict)
throws ZstdException
dstBuff - 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, dstBuff's position() will be set to its current position() plus the decompressed size of the data.
srcBuff - 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, srcBuff's position() will be set to its limit().
dict - the dictionary buffer to use for compressionZstdExceptionpublic static java.nio.ByteBuffer decompress(java.nio.ByteBuffer srcBuff,
byte[] dict,
int originalSize)
throws ZstdException
srcBuff - 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, srcBuff's position() will be set to its limit().
dict - the dictionary used in the compressionoriginalSize - the maximum size of the uncompressed dataZstdExceptionpublic static int decompress(java.nio.ByteBuffer dstBuff,
java.nio.ByteBuffer srcBuff,
ZstdDictDecompress dict)
throws ZstdException
dstBuff - 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, dstBuff's position() will be set to its current position() plus the decompressed size of the data.
srcBuff - 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, srcBuff's position() will be set to its limit().
dict - the dictionary buffer to use for compressionZstdExceptionpublic static java.nio.ByteBuffer decompress(java.nio.ByteBuffer srcBuff,
ZstdDictDecompress dict,
int originalSize)
throws ZstdException
srcBuff - 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, srcBuff's position() will be set to its limit().
dict - the dictionary used in the compressionoriginalSize - the maximum size of the uncompressed dataZstdException