Skip to content

Repository files navigation

PayPalChat on discord

NugetLatest releaseTotal downloadsTotal hits


Cached compression/decompression with QuickLz

Allows you to compress and decompress with QuickLz while keeping low the GC pressure

Main features:

  • 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

Usage:

Compress:
varlength=5000;vardata=newbyte[length]//Fill up the "data" array...
CachedQlz.Compress(refdata,reflength);//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!
Decompress:
//"data" is an array with compressed bytes...CachedQlz.Decompress(refdata,outvardecompressedLength);//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!

Array pool usage:

Request an array from the pool:
vararray=ArrayPool<byte>.Spawn(4);//Caution, array.Length will 8 instead of 4 as the cache system uses values based on powers of two
Return an array to the pool:
ArrayPool<byte>.Recycle(array);

Status:

BranchBuildTests
masterAppVeyorAppVeyor Tests

Email: gavazquez@gmail.comLicense

About

Compress and decompress with QuickLz while keeping low the Garbage Collector (NET Standard)

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages