如何在Java中进行LZW解码? [英] How can I do LZW decoding in Java?

查看:470
本文介绍了如何在Java中进行LZW解码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库,其中包含存储为二进制blob的图片数据。文档说数据是使用LZW编码的。我认为我可以使用Java库中的Zip或GZip输入流对其进行解码,但它不起作用 - 我得到一个例外,表示数据格式不正确。

I have a database which contains picture data stored as a binary blob. The documentation says the data is encoded using LZW. I thought that I could decode it using the Zip or GZip input streams found in the Java library, but it didn't work - I got an exception that said the format of the data is not correct.

根据我的阅读,图书馆使用的是DEFLATE,而不是LZW。此外,我已经阅读了有关使用LZW算法的一些许可问题。

From what I've read, the library uses DEFLATE, which is not LZW. Also, I've read about some licensing problems for using the LZW algorithm.

我可以使用什么来解码数据?有图书馆吗?我必须自己实施吗?许可问题怎么样?

What can I use to decode the data? Is there a library? Do I have to implement it myself? What about the licensing problems?

推荐答案

以下是几个链接:

http://u.cs.biu.ac.il/~freskom1/AlgProg1/ Progs / LZW.java

http://www.codeproject.com/KB/java/lzw.aspx

还有其他人。

确实如果图像是LZW压缩的TIFF文件, Java Advanced Imaging API 显然支持直接解码(尽管不是编码似乎)。

Indeed if the images are LZW compressed TIFF files, The Java Advanced Imaging API apparently supports decoding directly (though not encoding it seems).

这篇关于如何在Java中进行LZW解码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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