Why can't I decompress this LZW file in Java on Android? -


i need decompress text file download internet, around 256 kb compressed , 2 mb when extracted. linux file utility tells me it's "compress'd data 16 bits". looking it, have discovered compress uses lzw algorithm. 7-zip says "type" of file "z" (so extension), , able decompress file without issues, problem isn't in file. know problem isn't in how i'm downloading file, since stream of compressed bytes matches bytes shown when opening hex editor.

the file plain-text nowcasting matrix file environment canada. unfortunately don't have enough reputation add link.

i have been unable find built-in lzw decoders, i've had resort using third-party libraries. there quite few of these, none of ones have tried far have been able decompress file.

lzwj - throws indexoutofboundsexception: invalid index 40223, size 256. (the index isn't important). however, default codeword length 12. have changed source have codeword length of 16, output of file seems indicate (am wrong in assumption?), throws same exception (the index shown in error codeword length of 16).

this algorithm throws index out-of-bounds exception, after few modifications take input stream instead of file. however, appears have been written student assignment, i'm not comfortable using anyway.

this library unfortunately has compress method, , not decompression.

7-zip jbinding seemed best bet, unfortunately doesn't seem work on android, neither all-platforms jar or arm-only jar.

i have come across couple more libraries , individual class source files, have no license associated them , i'm avoiding copyrighted code.

can me find out cause of of these errors, or provide alternative solution?

you can try extract , use unlzw() routine in pigz.


Comments

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -