--- old/src/share/classes/java/util/zip/ZipOutputStream.java 2011-10-26 12:29:27.000000000 -0700 +++ new/src/share/classes/java/util/zip/ZipOutputStream.java 2011-10-26 12:29:27.000000000 -0700 @@ -161,6 +161,38 @@ def.setLevel(level); } + public void writeNextEntry(ZipEntry e, byte[] b, int off, int len) + throws IOException + { + ensureOpen(); + if (current != null) { + closeEntry(); // close previous entry + } + if (e.time == -1) { + e.setTime(System.currentTimeMillis()); + } + if (e.method != DEFLATED) { + throw new ZipException("writeNextEntry: e.method must be DEFLATED"); + } + if (e.size == -1 || e.csize == -1 || e.crc == -1) { + throw new ZipException("writeNextEntry: e.size/csize/crc is -1"); + } + if (! names.add(e.name)) { + throw new ZipException("duplicate entry: " + e.name); + } + if (zc.isUTF8()) + e.flag |= EFS; + current = new XEntry(e, written); + xentries.add(current); + writeLOC(current); + out.write(b, off, len); + written += len; + if ((e.flag & 8) != 0) + writeEXT(e); + crc.reset(); + current = null; + } + /** * Begins writing a new ZIP file entry and positions the stream to the * start of the entry data. Closes the current entry if still active. @@ -191,6 +223,7 @@ if (e.size == -1 || e.csize == -1 || e.crc == -1) e.flag = 8; + break; case STORED: // compressed size, uncompressed size, and crc-32 must all be