From: John L. <je...@pi...> - 2002-07-13 14:38:17
|
You seem to be a bit confused about the package names. Did you try using the classes in the net.sf.jazzlib namespace? By using those we can remove the possibility of the problem being caused by a mix of jazzlib and non-jazzlib code. Can you send me the input file you used (so that I can reproduce this bug)? Thanks for using jazzlib and taking the time to report the bug John Leuner On Fri, 2002-07-12 at 20: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: > > try > { > > // Create the GZIP output stream > String outFilename = strTo; > java.util.zip.GZIPOutputStream out = new > java.util.zip.GZIPOutputStream(new FileOutputStream(outFilename)); > > // Open the input file > String inFilename = strFrom; > FileInputStream in = new FileInputStream(inFilename); > > // Transfer bytes from the input file to the GZIP output > stream > byte[] buf = new byte[1024]; > int len; > while ((len = in.read(buf)) > 0) { > out.write(buf, 0, len); > } > in.close(); > > // Complete the GZIP file > out.finish(); > out.close(); > } > catch (IOException e) > { > System.out.println(e); > } > > > Thanks, > > Shawn Fuller > Software Specialist > E-Commerce Solutions West > 9 - 3777 Kingsway, Burnaby, BC > Tel 604.419.7527 > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Gadgets, caffeine, t-shirts, fun stuff. > http://thinkgeek.com/sf > _______________________________________________ > Jazzlib-developers mailing list > Jaz...@li... > https://lists.sourceforge.net/lists/listinfo/jazzlib-developers > |