[Kaffe] help with ZipOutputStream needed!

Moses DeJong dejong at cs.umn.edu
Wed Feb 17 20:20:07 PST 1999

Hi all.

I am working on the Kaffe java.util.zip libs in an attempt to get
them to output the same jar file data that is output by the JDK. I have
run into a problem that I need some help with. Does anyone out there
know enough about zlib and java.util.zip to help out with this?

First off, this is from a DEFLATED (compressed) ZipEntry that was
added to a ZipOutputStream using the putNextEntry() method. I can
provide the source code I am using if anyone wants it.

Here is a dump of the binary data output by Kaffe. The first 53
bytes of the file are the same but things differ at byte 54.
These are the 4 "extra" info bytes written to the stream at the end of
the ZipOutputStream.finish() method.

50      -2      -2      
51      -54     -54     
52      0       0       
53      0       0       

Now before DATA_HEADSIG (the 80, 75, 7, 8 set of bytes) is written in
the method ZipOutputStream.closeEntry() we see that 4 bytes are written
out by the Sun JVM while the Kaffe JVM only writes out 2 bytes (JDK
writes -29, -27, 2, 0 and Kaffe writes 3, 0).

(byte#) (Sun)   (Kaffe)

54      -29     3      
55      -27     0      
56      2       80     
57      0       75     
58      80      7      
59      75      8      
60      7       0       
61      8       0      

I looked around in the code and it looks like the call to super.finish()
inside the method ZipOutputStream.closeEntry() generates the call to
native code that actually writes out these bytes. Apparently this ends
up calling the java_util_zip_Deflater_deflate() method inside of Deflater.c
which goes on to call the deflate() method inside of zlib. Does anyone
know what might be going on here? Could this be an issue with the setting
of the default level or something?

Mo DeJong
dejong at cs.umn.edu

More information about the kaffe mailing list