aspose file tools
The moose likes Java in General and the fly likes how to read a unix compressed file? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to read a unix compressed file?" Watch "how to read a unix compressed file?" New topic
Author

how to read a unix compressed file?

X. Li
Ranch Hand

Joined: Jan 31, 2004
Posts: 61
Hi,

Can anyone tell me how to read a unix compressed file (*.Z)? Which class should I use?

Thanks in advance.

X. Li
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14568
    
    7

I don't believe there's a stock Java class to read .Z files created by the Unix "compress" program.

Compress has been largely supplanted by gzip anymore - I believe that it was disqualified from inclusion in Linux due to licensing restrictions. Someone holds a patent on the algorithm or something like that.

Although a little googling makes me suspect that some versions of gzip and compress are compatible, originally this wasn't supposed to be the case. If your ".Z" file can be uncompressed with the gunzip utility, you could try the unzip java class and see if that works.


Customer surveys are for companies who didn't pay proper attention to begin with.
X. Li
Ranch Hand

Joined: Jan 31, 2004
Posts: 61
Thank you for your reply.

I googled, and found a class. It does work pretty well:

http://cvs.sf.net/viewcvs.py/skunkdav/skunkdav/HTTPClient/UncompressInputStream.java?sortby=author&view=markup
John Carroll
Greenhorn

Joined: Nov 12, 2003
Posts: 2
Thanks for posting that link, I really need that

John.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to read a unix compressed file?
 
Similar Threads
Decompress Unix compressed .z file
Connecting to Unix via Windows
how to read a .z file in c++?
How to read a unix compressed file?
unix filepath to file class