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











SourceForge.net Logo

SourceForge.net Logo

GitHub Logo

Discord Logo

ZstdCompressStream

 

class ZstdCompressStream : public Stream

Zstandard is a very fast (200MB/s per CPU core) compression algorithm with good compression ratio (average 50%) by Yann Collet. File compressed using ZstdCompressStream can be decompressed by Zstd commandline utilities.

 

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, int level = 1)

out level .

 


 

ZstdCompressStream(Stream& out, int level = 1)

Sets the output stream where compressed data are stored. level is the compression level - higher levels provide better compression but slower speed. For fast compression, level 1 is recommended.

 

ZstdDecompressStream

 

class ZstdDecompressStream : public Stream

Provides Zstd decompression.

 

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)

ZstdDecompressStream(Stream& in)

Sets the input stream from where compressed data are read.

 

 

Zstd Compress/Decompress functions

 

int64 ZstdCompress(Stream& out, Stream& in, EventGate<int64, int64progress = false)

int64 ZstdDecompress(Stream& out, Stream& in, EventGate<int64, int64progress = false)

String ZstdCompress(const void *data, int64 len, EventGate<int64, int64progress = false)

String ZstdCompress(const String& s, EventGate<int64, int64progress = false)

String ZstdDecompress(const void *data, int64 len, EventGate<int64, int64progress = false)

String ZstdDecompress(const String& s, EventGate<int64, int64progress = false)

int64 CoZstdCompress(Stream& out, Stream& in, EventGate<int64, int64progress = false)

int64 CoZstdDecompress(Stream& out, Stream& in, EventGate<int64, int64progress = false)

String CoZstdCompress(const void *data, int64 len, EventGate<int64, int64progress = false)

String CoZstdCompress(const String& s, EventGate<int64, int64progress = false)

String CoZstdDecompress(const void *data, int64 len, EventGate<int64, int64progress = false)

String CoZstdDecompress(const String& s, EventGate<int64, int64progress = false)

Simple Zstd 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 IsZstd(Stream& s)

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

 

 

Do you want to contribute?