[Kaffe] another ZipOutputStream patch

Moses DeJong dejong at cs.umn.edu
Tue Feb 16 13:19:37 PST 1999


Hello.

I have found another little difference in the zip streams generated
by kaffe and the JDK. This patch will make the "flag" output the
same as the JDK.


RCS file: /home/cvspublic/kaffe/libraries/javalib/java/util/zip/ZipOutputStream.java,v
retrieving revision 1.4
diff -u -r1.4 ZipOutputStream.java
--- ZipOutputStream.java        1999/02/16 19:44:21     1.4
+++ ZipOutputStream.java        1999/02/16 22:22:32
@@ -195,9 +195,6 @@
 {
        closeEntry();   // Close previous entry
 
-       put32(lh, LOC_SIGNATURE, (int)LOC_HEADSIG);
-       put16(lh, LOC_VERSIONEXTRACT, ZIPVER);
-       put16(lh, LOC_FLAGS, ze.flag);
        if (ze.method == -1) {
                ze.method = method;
        }
@@ -210,6 +207,7 @@
                        throw new ZipException("crc not set in stored entry");
                }
        }
+       ze.flag = ze.method;
 
        if (curr == null || curr.method != ze.method) {
                if (ze.method == STORED) {
@@ -219,6 +217,10 @@
                        def = new Deflater(level, true);
                }
        }
+
+       put32(lh, LOC_SIGNATURE, (int)LOC_HEADSIG);
+       put16(lh, LOC_VERSIONEXTRACT, ZIPVER);
+       put16(lh, LOC_FLAGS, ze.flag);
 
        put16(lh, LOC_METHOD, ze.method);
        put16(lh, LOC_TIME, 0);


Mo DeJong
dejong at cs.umn.edu



More information about the kaffe mailing list