javalzo

Java LZO compression library


I'm trying to use LZO compression library inside my Java program (http://www.oberhumer.com/opensource/lzo/). I could not find a single example how to use it for compression and decompression of data. Can anybody help me with it? Apparently the native code is not in Java, so I'm not also sure what steps to take to use it (JNI or something?!)


Solution

  • The original code from Oberhumer does not contain a java compressor. You might want to have a look at https://github.com/shevek/lzo-java.

    Does it have to be LZO or would another compression algorithm also work? There is a nice benchmarking suite of compression algorithms in Java available on GitHub: https://github.com/ning/jvm-compressor-benchmark. Looking at the results there, it seems there are other algorithms providing more or less the same compression rate but are much faster.

    I personally use iq80's snappy implementation (https://github.com/dain/snappy) regularly in apps where I need in-memory compression. It is pure java, so it runs everywhere, but still very fast.