java读取lzo,Java LZO压缩库

本文介绍了如何在Java程序中使用LZO压缩库,并提到Oberhumer提供的原代码缺乏Java压缩功能。推荐了shevek/lzo-java库和Java的其他快速压缩算法,如Snappy,以及性能基准比较。
摘要由CSDN通过智能技术生成

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?!)

解决方案

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值