public class SnappyCompressor extends java.lang.Object implements Compressor
Modifier and Type | Field and Description |
---|---|
static SnappyCompressor |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
int |
compress(byte[] src,
int srcOffset,
int length,
byte[] dest,
int destOffset) |
byte[] |
decompress(byte[] src,
int offset,
int length,
int expectedDecompressedLength) |
int |
maxCompressedLength(int length) |
public static final SnappyCompressor INSTANCE
public int maxCompressedLength(int length)
maxCompressedLength
in interface Compressor
length
- the decompressed length being compressedpublic int compress(byte[] src, int srcOffset, int length, byte[] dest, int destOffset) throws java.io.IOException
compress
in interface Compressor
src
- the input bytes to be compressedsrcOffset
- the offset to start compressing src fromlength
- the total number of bytes from srcOffset to pass to the compressor implementationdest
- the output buffer to write the compressed bytes todestOffset
- the offset into the dest buffer to start writing the compressed bytesjava.io.IOException
- if the compression implementation failed while compressing the input bytespublic byte[] decompress(byte[] src, int offset, int length, int expectedDecompressedLength) throws java.io.IOException
decompress
in interface Compressor
src
- the compressed bytes to be decompressedexpectedDecompressedLength
- the expected length the input bytes will decompress tojava.io.IOException
- thrown if the compression implementation failed to decompress the provided input bytesCopyright © 2009-2020 The Apache Software Foundation