Package me.lemire.integercompression
Class IntCompressor
java.lang.Object
me.lemire.integercompression.IntCompressor
This is a convenience class that wraps a codec to provide
a "friendly" API.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor with default codec.Constructor wrapping a codec. -
Method Summary
Modifier and TypeMethodDescriptionint[]
compress
(int[] input) Compress an array and returns the compressed result as a new array.int[]
uncompress
(int[] compressed) Uncompress an array and returns the uncompressed result as a new array.
-
Constructor Details
-
IntCompressor
Constructor wrapping a codec.- Parameters:
c
- the underlying codec
-
IntCompressor
public IntCompressor()Constructor with default codec.
-
-
Method Details
-
compress
public int[] compress(int[] input) Compress an array and returns the compressed result as a new array.- Parameters:
input
- array to be compressed- Returns:
- compressed array
- Throws:
UncompressibleInputException
- if the data is too poorly compressible
-
uncompress
public int[] uncompress(int[] compressed) Uncompress an array and returns the uncompressed result as a new array.- Parameters:
compressed
- compressed array- Returns:
- uncompressed array
-