Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

LZ4CompressStream

 

class LZ4CompressStream : public Stream

Provides LZ4 compression. LZ4 is extremely fast (400MB/s per CPU core) compression algorithm by Yann Collet, with average compression ration at around 60%. Compressed stream follows LZ4 frame format (and thus can be decompressed by commandline routines provided by LZ4 author, Yann Collet).

 

Public Method List

 

void Co(bool b = true)

Activates multithreaded mode. The parallelization is completely encapsulated, nothing special is required from calling thread.

 


 

void Open(Stream& out_)

LZ4CompressStream(Stream& out)

Sets the output stream where compressed data are stored.

 

LZ4DecompressStream

 

class LZ4DecompressStream : public Stream

Provides LZ4 decompression. It is guaranteed to decompress stream compressed by plugin/lz4 and most (but not all) of lz4-frame format compliant streams.

 

Public Method List

 

void Co(bool b = true)

Activates multithreaded mode. The parallelization is completely encapsulated, nothing special is required from calling thread.

 


 

bool Open(Stream& in)

LZ4DecompressStream(Stream& in)

Sets the input stream from where compressed data are read.

 

LZ4 Compress/Decompress functions

 

int64 LZ4Compress(Stream& out, Stream& in, Gate<int64, int64progress = Null)

int64 LZ4Decompress(Stream& out, Stream& in, Gate<int64, int64progress = Null)

String LZ4Compress(Stream& in, Gate<int64, int64progress)

String LZ4Decompress(Stream& in, Gate<int64, int64progress)

String LZ4Compress(const void *data, int64 len, Gate<int64, int64progress = Null)

String LZ4Compress(const String& s, Gate<int64, int64progress = Null)

String LZ4Decompress(const void *data, int64 len, Gate<int64, int64progress = Null)

String LZ4Decompress(const String& s, Gate<int64, int64progress = Null)

int64 CoLZ4Compress(Stream& out, Stream& in, Gate<int64, int64progress = Null)

int64 CoLZ4Decompress(Stream& out, Stream& in, Gate<int64, int64progress = Null)

String CoLZ4Compress(Stream& in, Gate<int64, int64progress)

String CoLZ4Decompress(Stream& in, Gate<int64, int64progress)

String CoLZ4Compress(const void *data, int64 len, Gate<int64, int64progress = Null)

String CoLZ4Compress(const String& s, Gate<int64, int64progress = Null)

String CoLZ4Decompress(const void *data, int64 len, Gate<int64, int64progress = Null)

String CoLZ4Decompress(const String& s, Gate<int64, int64progress = Null)

Simple LZ4 compression/decompression functions. out in parameters are input / ouput streams and function returns the number of bytes stored to out, otherwise input is provided as memory block data of len bytes or as input String data and output is String return value. progress can be used to to track progress of operation and eventually interrupt it by returning true. Functions with Co prefix run multithreaded.

 

 


 

bool IsLZ4(Stream& s)

Checks the Stream for magic number identifying LZ4 stream. Seeks back after the check. Returns true if magic number was detected.

 

 

 

Do you want to contribute?