• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to read a unix compressed file?  RSS feed

 
X. Li
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18800
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
X. Li
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting that link, I really need that

John.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!