From: Jochen H. <Hoe...@In...> - 2002-07-23 09:18:00
|
On Friday, 12. July 2002 21:55, Shawn Fuller wrote: > When I use the GZIPOutputStream in the jazz.util.zip package the > resulting file cannot be unzipped using gunzip. (Error msg: gunzip: > test1.txt.gz: invalid compressed data--crc error) Howerver, if I > use java.util.zip it works. Any ideas why? > > The following code works once I substituted the native class > java.util.zip.GZIPOutputStream: > > // Complete the GZIP file > out.finish(); > out.close(); I think I know the problem: The method finish() writes the footer with the CRC checksum and file size. close() calls finish() and writes the footer again. The way to fix this is to remember whether the footer has already been written. Jochen -- Jochen Hoenicke, University of Oldenburg, 26111 Oldenburg, Germany Email: hoe...@in... Tel: +49 441 798 3124 |