ogrishman / lzo.net

implementation of the lzo decoder in plain c#/.NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

implementation of the lzo decoder in plain c#/.NET

License:MIT License


Languages

Language:C# 100.0%