-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
1.2fcs
-
sparc
-
solaris_2.5
-
Verified
Name: sdC67446 Date: 01/09/98
Method java.util.zip.ZipOutputStream.write allows writing after calling
close() method.
Here is the test demonstrating the bug:
-----------------Test.java------------------------
import java.util.zip.*;
import java.io.*;
public class Test {
public static void main(String[] args) {
try {
byte[] buf = {1};
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ZipOutputStream zos = new ZipOutputStream(baos);
zos.putNextEntry(new ZipEntry("1"));
zos.write(buf,0,1);
zos.close();
zos.putNextEntry(new ZipEntry("2"));
zos.write(buf,0,1);
System.out.println("It's not good.");
} catch (Exception e) {
System.out.println(e+" - IT'S OK.");
}
}
}
---------Output from the test---------------------
It's not good.
--------------------------------------------------
======================================================================