How can I do LZW decoding in Java?

前端 未结 4 2003
不知归路
不知归路 2020-12-18 04:19

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 o

相关标签:
4条回答
  • 2020-12-18 04:26

    I went through a surprising amount of LZW implementations before finding one that worked for my case.

    UncompressedInputStream from the BioJava project worked for me, when I needed to unpack a .pax file.

    0 讨论(0)
  • 2020-12-18 04:34

    I know the question is old, but I just wanted to add a great resource about LZW:

    http://www.matthewflickinger.com/lab/whatsinagif/lzw_image_data.asp

    It's more specifically about the use of LZW in GIF images, but it explains the compression and decompression algorithms pretty well.

    0 讨论(0)
  • 2020-12-18 04:39

    You can also try with 7-Zip JBinding which uses the 7zip library internally. It's quite easy to use.

    0 讨论(0)
  • 2020-12-18 04:51

    Here are a couple of links:

    • http://www.cs.sfu.ca/CC/365/li/squeeze/LZW.html

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

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

    And there are others.

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

    0 讨论(0)
提交回复
热议问题