implementation of the lzo decoder in plain c#/.NET
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitattributes
.gitignore
LICENSE
README.md
lzo.net.sln

README.md

Build status Nuget version

lzo.net

This is an implementation of the lzo decoder in plain c#/.NET (without P/Invoke, fixed or unchecked).

The first version was based on the decoder from ffmpeg, but was replaced with a rewrite based on the documentation from kernel.org.

Features

Currently only decompression is supported.

License

The early versions contain a port from ffmpeg, which is licensed under LGPL v2.1. Later version do not contain any LGPL code anymore, so the license was switched to MIT. Details can be found in the LICENSE file for each version.

Usage

Install from nuget.

using (var compressed = File.OpenRead("File.lzo"))
using (var decompressed = new LzoStream(compressed, CompressionMode.Decompress))
{
    decompressed.Read(buffer, offset, count);
    ...
}

Performance

The code was optimized as much as possible but since it's plain .NET it is of course slower then the native c version. Benchmarks (on the test files) show a performance penalty around factor 3. If you require the best performance, consider using another library which wraps the native version.

Please open an issue, if you've found a way to make the decoder faster.