LZO.Net High-speed compression for .Net

Posted Monday, August 21, 2006 2:29 PM by Maurice
Looking for a compression library that gets around? LZO is a fast compression library that was actually uses on the NASA rovers Spirit and Opportunity. Michael Link created a .NET wrapper class so using it is a breeze. The following is the sample application listed on the LZO.NET home page:
 
// Create the compressor object
LZOCompressor lzo = newLZOCompressor();
 
// Build a quite redundant string
StringBuilder sb = newStringBuilder();
for (int i = 0; i < 10000; i++)
{
    sb.Append("LZO.NET");
}
string str = sb.ToString();
Console.WriteLine("Original-Length: " + str.Length);
 
// Now compress the 70000 byte string to something much smaller
byte[] compressed = lzo.Compress(Encoding.Default.GetBytes(str));
Console.WriteLine("Compressed-Length: " + compressed.Length);
 
// Decompress the string to its original content
string str2 = Encoding.Default.GetString(lzo.Decompress(compressed));
Console.WriteLine("Decompressed-Length: " + str2.Length);
Console.WriteLine("Equality: " + str.Equals(str2));
 
Even though no mention is made of .NET 2.0 it still works just as advertised.
 
Take a look at http://lzo-net.sourceforge.net/ for the LZO.NET project or http://www.oberhumer.com/ for the original LZO project.

 
 
 
Maurice de Beijer
Filed under:

Comments

# re: LZO.Net High-speed compression for .Net

Wednesday, September 20, 2006 11:18 PM by imran

where can i get the .NET wrapper class  to use lzo in my vb.net application?

# re: LZO.Net High-speed compression for .Net

Thursday, September 21, 2006 1:23 AM by Maurice

Hi Imran,

You can download the .NET wrapper for the LZO compression library from the SourceForge site at http://sourceforge.net/project/showfiles.php?group_id=102072

# re: LZO.Net High-speed compression for .Net

Monday, March 31, 2008 6:38 AM by madhu

i am getting error while i am using in vb.net

object reference not set to an instance of an object

# re: LZO.Net High-speed compression for .Net

Monday, April 21, 2008 2:53 AM by praveen

hi, i am praveen i am working with a project of atm system Software.

i us VB.NET as front end and oracle as back end.

i want to create a mini statement module so what i do.

Leave a Comment

(required) 
(required) 
(optional)
(required)