Cached compression/decompression with QuickLz
Allows you to compress and decompress with QuickLz while keeping low the GC pressure
- Fast compression/decompression using QuickLz algorithm
- Includes an array pool to request/recycle arrays in case you want to return them once you've compressed/decompressed their data
var length = 5000;
var data = new byte[length]
//Fill up the "data" array...
CachedQlz.Compress(ref data, ref length);
//Now "data" is an array with the compressed bytes. If you want to check it's length use the variable "length"
//Do NOT use data.Length! It might be bigger as it came from a cached array!
//"data" is an array with compressed bytes...
CachedQlz.Decompress(ref data, out var decompressedLength);
//Now "data" is an array with the decompressed bytes. If you want to check it's length use the variable "length"
//Do NOT use data.Length! It might be bigger as it came from a cached array!
var array = ArrayPool<byte>.Spawn(4);
//Caution, array.Length will 8 instead of 4 as the cache system uses values based on powers of two
ArrayPool<byte>.Recycle(array);
Branch | Build | Tests |
---|---|---|
master |