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,
int level)
Compresses buffer 'src' into buffer 'dst'.
|
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 long |
compressBound(long srcSize)
Maximum size of the compressed data
|
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 |
compressUsingDict(byte[] dst,
byte[] src,
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 byte[] |
decompress(byte[] src,
int originalSize)
Decompress data
|
static byte[] |
decompress(byte[] src,
ZstdDictDecompress dict,
int originalSize)
Decompress data
|
static long |
decompressedSize(byte[] src)
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 |
decompressUsingDict(byte[] dst,
byte[] src,
byte[] dict)
Decompresses buffer 'src' into buffer 'dst' with dictionary.
|
static long |
decompressUsingDict(byte[] dst,
int dstOffset,
byte[] src,
int srcOffset,
int length,
byte[] dict)
Decompresses buffer 'src' into buffer 'dst' with dictionary.
|
static int |
frameHeaderSizeMax() |
static int |
frameHeaderSizeMin() |
static java.lang.String |
getErrorName(long code) |
static int |
hashLogMax() |
static int |
hashLogMin() |
static boolean |
isError(long code)
Error handling
|
static int |
magicNumber() |
static int |
searchLengthMax() |
static int |
searchLengthMin() |
static int |
searchLogMax() |
static int |
searchLogMin() |
static int |
targetLengthMax() |
static int |
targetLengthMin() |
static long |
trainFromBuffer(byte[][] samples,
byte[] dictBuffer)
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)
dst - the destination buffersrc - the source bufferlevel - compression levelpublic static long decompress(byte[] dst,
byte[] src)
dst - the destination buffersrc - the source bufferpublic static long decompressedSize(byte[] src)
src - the compressed bufferpublic 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 'src'dict - the dictionary bufferlevel - compression levelpublic 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 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 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 'src'dict - the dictionarypublic 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 trainFromBuffer(byte[][] samples,
byte[] dictBuffer)
samples - the samples buffer arraydictBuffer - the new dictionary bufferpublic 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 targetLengthMin()
public static int targetLengthMax()
public static int frameHeaderSizeMin()
public static int frameHeaderSizeMax()
public static int blockSizeMax()
public static byte[] compress(byte[] src,
int level)
src - the source bufferlevel - compression levelpublic static byte[] compress(byte[] src,
ZstdDictCompress dict)
src - the source bufferdict - dictionary to usepublic static byte[] compress(byte[] src)
src - the source bufferpublic static byte[] decompress(byte[] src,
int originalSize)
src - the source bufferoriginalSize - the maximum size of the uncompressed datapublic static byte[] decompress(byte[] src,
ZstdDictDecompress dict,
int originalSize)
src - the source bufferdict - dictionary to useoriginalSize - the maximum size of the uncompressed datapublic static long compressUsingDict(byte[] dst,
byte[] src,
byte[] dict,
int level)
dst - the destination buffersrc - the source bufferdict - the dictionary bufferlevel - compression levelpublic static long decompressUsingDict(byte[] dst,
byte[] src,
byte[] dict)
dst - the destination buffersrc - the source bufferdict - the dictionary buffer