Class LZ4
LZ4 compression and decompression routines.
http://code.google.com/p/lz4/ http://fastcompression.blogspot.fr/p/lz4.html
Inheritance
Inherited Members
Namespace: Lucene.Net.Codecs.Compressing
Assembly: Lucene.Net.dll
Syntax
public sealed class LZ4
Methods
| Improve this Doc View SourceCompress(Byte[], Int32, Int32, DataOutput, LZ4.HashTable)
Compress bytes[off:off+len]
into out
using
at most 16KB of memory. ht
shouldn't be shared across threads
but can safely be reused.
Declaration
public static void Compress(byte[] bytes, int off, int len, DataOutput out, LZ4.HashTable ht)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | |
System.Int32 | off | |
System.Int32 | len | |
DataOutput | out | |
LZ4.HashTable | ht |
CompressHC(Byte[], Int32, Int32, DataOutput, LZ4.HCHashTable)
Compress bytes[off:off+len]
into out
. Compared to
Compress(Byte[], Int32, Int32, DataOutput, LZ4.HashTable), this method
is slower and uses more memory (~ 256KB per thread) but should provide
better compression ratios (especially on large inputs) because it chooses
the best match among up to 256 candidates and then performs trade-offs to
fix overlapping matches. ht
shouldn't be shared across threads
but can safely be reused.
Declaration
public static void CompressHC(byte[] src, int srcOff, int srcLen, DataOutput out, LZ4.HCHashTable ht)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | src | |
System.Int32 | srcOff | |
System.Int32 | srcLen | |
DataOutput | out | |
LZ4.HCHashTable | ht |
Decompress(DataInput, Int32, Byte[], Int32)
Decompress at least decompressedLen
bytes into
dest[dOff]
. Please note that dest
must be large
enough to be able to hold all decompressed data (meaning that you
need to know the total decompressed length).
Declaration
public static int Decompress(DataInput compressed, int decompressedLen, byte[] dest, int dOff)
Parameters
Type | Name | Description |
---|---|---|
DataInput | compressed | |
System.Int32 | decompressedLen | |
System.Byte[] | dest | |
System.Int32 | dOff |
Returns
Type | Description |
---|---|
System.Int32 |