public interface Compressor
ICompressor
, but different enough that
it's worth specializing:
Modifier and Type | Method and Description |
---|---|
int |
compress(byte[] src,
int srcOffset,
int length,
byte[] dest,
int destOffset) |
byte[] |
decompress(byte[] src,
int srcOffset,
int length,
int expectedDecompressedLength) |
int |
maxCompressedLength(int length) |
int maxCompressedLength(int length)
length
- the decompressed length being compressedint compress(byte[] src, int srcOffset, int length, byte[] dest, int destOffset) throws java.io.IOException
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 bytesbyte[] decompress(byte[] src, int srcOffset, int length, int expectedDecompressedLength) throws java.io.IOException
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