aspose file tools*
The moose likes Java in General and the fly likes GZipInputStream & ZipInputStream? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "GZipInputStream & ZipInputStream?" Watch "GZipInputStream & ZipInputStream?" New topic
Author

GZipInputStream & ZipInputStream?

Andrew Mcmurray
Ranch Hand

Joined: Sep 24, 2005
Posts: 188
Hi all ,

I am trying to stream data from zip files. Everything works fine when I get Gzip files and use the GZipInputStream. When I use the same code and switch the GZipInputStream to ZipInputStream it does not work. It looks like the first line being read in a null? Any thoughts? Here is a snip of code I am useing



Thanks,

AMD
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8708
    
    6

Gzip and Zip files have different formats and require different handling. Have a look at this Zip example and compare it to this Gzip example.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Andrew Mcmurray
Ranch Hand

Joined: Sep 24, 2005
Posts: 188
Ah so I am guessing I need to add the ZipEntry entry = in.getNextEntry();
to clear the null that I am getting on the first line?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GZipInputStream & ZipInputStream?
 
Similar Threads
Unzipping a .zip file containing .gif files
how to unzip a file of type struts.upload.FormFile?
Accessing image in a zip file
problems with unziping image files
Another way to write this?