Package com.yahoo.compress
Class ZstdCompressor
- java.lang.Object
-
- com.yahoo.compress.ZstdCompressor
-
public class ZstdCompressor extends Object
Frame based Zstd compressor (https://github.com/facebook/zstd) Implemented based on https://github.com/airlift/aircompressor - a pure Java implementation (no JNI).- Author:
- bjorncs
-
-
Constructor Summary
Constructors Constructor Description ZstdCompressor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
compress(byte[] input, int inputOffset, int inputLength)
int
compress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength)
byte[]
decompress(byte[] input, int inputOffset, int inputLength)
Note: Implementation assumes single frame (sincegetDecompressedLength(byte[], int, int)
only includes the first frame) Thedecompress(byte[], int, int, byte[], int, int)
overload will try to decompress all frame, causing the output buffer to overflow.int
decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength)
static int
getDecompressedLength(byte[] input, int inputOffset, int inputLength)
static int
getMaxCompressedLength(int uncompressedLength)
-
-
-
Method Detail
-
compress
public byte[] compress(byte[] input, int inputOffset, int inputLength)
-
compress
public int compress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength)
-
decompress
public byte[] decompress(byte[] input, int inputOffset, int inputLength)
Note: Implementation assumes single frame (sincegetDecompressedLength(byte[], int, int)
only includes the first frame) Thedecompress(byte[], int, int, byte[], int, int)
overload will try to decompress all frame, causing the output buffer to overflow.
-
decompress
public int decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength)
-
getMaxCompressedLength
public static int getMaxCompressedLength(int uncompressedLength)
-
getDecompressedLength
public static int getDecompressedLength(byte[] input, int inputOffset, int inputLength)
-
-