Package org.apache.lucene.util.compress
Class LZ4
- java.lang.Object
-
- org.apache.lucene.util.compress.LZ4
-
public final class LZ4 extends Object
LZ4 compression and decompression routines. https://github.com/lz4/lz4/tree/dev/lib http://fastcompression.blogspot.fr/p/lz4.html The high-compression option is a simpler version of the one of the original algorithm, and only retains a better hash table that remembers about more occurrences of a previous 4-bytes sequence, and removes all the logic about handling of the case when overlapping matches are found.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLZ4.FastCompressionHashTableSimple lossyLZ4.HashTablethat only stores the last ocurrence for each hash on2^14bytes of memory.static classLZ4.HighCompressionHashTableA higher-precisionLZ4.HashTable.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcompress(byte[] bytes, int off, int len, DataOutput out, org.apache.lucene.util.compress.LZ4.HashTable ht)Compressbytes[off:off+len]intooutusing at most 16KB of memory.static intdecompress(DataInput compressed, int decompressedLen, byte[] dest)Decompress at leastdecompressedLenbytes intodest[dOff:].
-
-
-
Method Detail
-
decompress
public static int decompress(DataInput compressed, int decompressedLen, byte[] dest) throws IOException
Decompress at leastdecompressedLenbytes intodest[dOff:]. Please note thatdestmust be large enough to be able to hold all decompressed data (meaning that you need to know the total decompressed length).- Throws:
IOException
-
compress
public static void compress(byte[] bytes, int off, int len, DataOutput out, org.apache.lucene.util.compress.LZ4.HashTable ht) throws IOExceptionCompressbytes[off:off+len]intooutusing at most 16KB of memory.htshouldn't be shared across threads but can safely be reused.- Throws:
IOException
-
-