Java LZO压缩库 [英] Java LZO compression library

查看:603
本文介绍了Java LZO压缩库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的Java程序中使用LZO压缩库( http://www.oberhumer的.com /开源/ LZO / )。我找不到一个如何使用它来压缩和解压缩数据的例子。任何人都可以帮我吗?显然本机代码不是Java,所以我不确定要使用它的步骤(JNI或其他东西?!)

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

推荐答案

Oberhumer的原始代码不包含java压缩器。您可能需要查看 https://github.com/shevek/lzo-java

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.

是否必须是LZO或其他压缩算法是否也有效?
GitHub上有一个很好的Java压缩算法基准测试套件: https:/ /github.com/ning/jvm-compressor-benchmark 。看看那里的结果,似乎有其他算法提供或多或少相同的压缩率,但更快。

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.

我个人使用iq80的快速实现( https://github.com/dain/snappy )定期在我需要内存压缩的应用中。它是纯java,因此它可以在任何地方运行,但仍然非常快。

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.

这篇关于Java LZO压缩库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆