C# Class LZ4Sharp.LZ4

Static LZ4 Compression and Decompression. This is threadsafe because it creates new instances of the compression/decompression classes for each method call. It is recommended to use LZ4Compressor and LZ4Decompressor for repeated compressing/decompressing for speed and less memory allocations.
Show file Open project: stangelandcl/LZ4Sharp

Public Methods

Method Description
CalculateMaxCompressedLength ( int uncompressedLength ) : int

Calculate the max compressed byte[] size given the size of the uncompressed byte[]

Compress ( byte source ) : byte[]
Compress ( byte source, byte dest ) : int

Compress source into dest returning compressed length

Compress ( byte source, int srcOffset, int count, byte dest, int dstOffset ) : int

Compress source into dest returning compressed length

Decompress ( byte compressed ) : byte[]
Decompress ( byte compressed, byte decompressedBuffer ) : int
Decompress ( byte compressedBuffer, byte decompressedBuffer, int compressedSize ) : int
Decompress ( byte compressedBuffer, byte decompressedBuffer, int compressedSize, int maxDecompressedSize ) : int
DecompressKnownSize ( byte compressed, byte decompressedBuffer, int decompressedSize ) : int
DecompressKnownSize ( byte compressed, byte decompressed ) : void

Method Details

CalculateMaxCompressedLength() public static method

Calculate the max compressed byte[] size given the size of the uncompressed byte[]
public static CalculateMaxCompressedLength ( int uncompressedLength ) : int
uncompressedLength int Length of the uncompressed data
return int

Compress() public static method

public static Compress ( byte source ) : byte[]
source byte
return byte[]

Compress() public static method

Compress source into dest returning compressed length
public static Compress ( byte source, byte dest ) : int
source byte uncompressed data
dest byte array into which source will be compressed
return int

Compress() public static method

Compress source into dest returning compressed length
public static Compress ( byte source, int srcOffset, int count, byte dest, int dstOffset ) : int
source byte uncompressed data
srcOffset int offset in source array where reading will start
count int count of bytes in source array to compress
dest byte array into which source will be compressed
dstOffset int start index in dest array where writing will start
return int

Decompress() public static method

public static Decompress ( byte compressed ) : byte[]
compressed byte
return byte[]

Decompress() public static method

public static Decompress ( byte compressed, byte decompressedBuffer ) : int
compressed byte
decompressedBuffer byte
return int

Decompress() public static method

public static Decompress ( byte compressedBuffer, byte decompressedBuffer, int compressedSize ) : int
compressedBuffer byte
decompressedBuffer byte
compressedSize int
return int

Decompress() public static method

public static Decompress ( byte compressedBuffer, byte decompressedBuffer, int compressedSize, int maxDecompressedSize ) : int
compressedBuffer byte
decompressedBuffer byte
compressedSize int
maxDecompressedSize int
return int

DecompressKnownSize() public static method

public static DecompressKnownSize ( byte compressed, byte decompressedBuffer, int decompressedSize ) : int
compressed byte
decompressedBuffer byte
decompressedSize int
return int

DecompressKnownSize() public static method

public static DecompressKnownSize ( byte compressed, byte decompressed ) : void
compressed byte
decompressed byte
return void