[Kaffe] patch for ZipOutputStream

Moses DeJong dejong at cs.umn.edu
Fri Feb 12 21:57:19 PST 1999


Hello,

I found another bug in Kaffe's implementation of the ZipOutputStream
class. The details of how to trigger the bug and the patch to fix it
are included below.



// File DefaultZipEntry.java


import java.io.*;
import java.util.zip.*;

//import java.util.jar.*;

public class DefaultZipEntry {

    public static void main(String[] argv) throws Exception {
	File outfile = new File("tmp.jar");
	
	FileOutputStream fout = new FileOutputStream(outfile);

	ZipOutputStream out = new ZipOutputStream(fout);

	ZipEntry ze = new ZipEntry("temp");
	
	// comment out to get failure in kaffe
	//ze.setMethod(ZipEntry.DEFLATED);

	out.putNextEntry(ze);

	out.close();

	System.out.println("worked");
    }
}




/*

with ze.setMethod(ZipEntry.DEFLATED)



JDK 1.2

% java DefaultZipEntry
worked


Kaffe

% kaffe DefaultZipEntry
worked




with ze.setMethod((ZipEntry.DEFLATED) commented out


JDK 1.2

% java DefaultZipEntry
worked



Kaffe

% kaffe DefaultZipEntry
java.util.zip.ZipException: size not set in stored entry



So this makes me think that the default compression method
is DEFLATED in the JDK but it is STORED in Kaffe.







More information about the kaffe mailing list