- DotFastLZ is a C# port of ariya/FastLZ
- DotFastLZ can be used in C# projects and Unity3D, and it's great for compressing small, repetitive data.
for (int level = 1; level <= 2; ++level)
{
// compress
var input = GetInputSource();
var estimateSize = FastLZ.EstimateCompressedSize(input.Length);
var comBuf = new byte[estimateSize];
var comBufSize = FastLZ.CompressLevel(level, input, input.Length, comBuf);
// decompress
byte[] decBuf = new byte[input.Length];
var decBufSize = FastLZ.Decompress(comBuf, comBufSize, decBuf, decBuf.Length);
// compare
var compareSize = FastLZ.MemCompare(input, 0, decBuf, 0, decBufSize);
// check
Assert.That(decBufSize, Is.EqualTo(input.Length), "decompress size error");
Assert.That(compareSize, Is.EqualTo(input.Length), "decompress compare error");
}
$ 6pack --help
6pack: high-speed file compression tool
Copyright (C) Ariya Hidayat, Choi Ikpil([email protected])
- https://github.com/ikpil/DotFastLZ
Usage: 6pack [options] input-file output-file
Options:
-1 compress faster
-2 compress better
-v show program version
-d decompression (default for .fastlz extension)
-mem check in-memory compression speed