Code review request 7077769: (zipfs) ZipFileSystem.writeCEN() writes wrong "data size" for ZIP64 extended information extra field

Xueming Shen xueming.shen at oracle.com
Wed Aug 24 00:32:41 UTC 2011


The fix tires to address two issues in ZipFileSystem class

(1) The OutputStream used to write out the bits in sync() is not wrapped
by a BufferedOutputStream. Without the BufferedOutputStream wrapper,
we basically write all ZIP header tables (loc and cen) byte by byte. How
big is the impact to the performance? With the BufferedOutputStream, the
time we spend on sync/writing a Jar file in size of 64M (our rt.jar) 
improved
from 3640 ms to 1315 ms on my local machine.

(2) The writeCEN() incorrectly sets the data size of the ZIP64 extended
information extra field block.  The "data size" should be the size of the
ZIP64 data block only, should not include the 4-byte header (the ZFS.
writeCEN() accidentally includes these extra 4 bytes). It is implemented
correctly in ZipOutputStream. (Read works fine in ZipInputStream, ZipFile
and ZipFileSystem, for both the loc and cen headers).

The same change will need go into 7u2 as well.

Fix has been verified/test manually with existing test cases. Given the 
nature
of the > 4G zip data file. I'm not including an auto regression test.

Webrev is at

http://cr.openjdk.java.net/~sherman/7077769/webrev 
<http://cr.openjdk.java.net/%7Esherman/7077769/webrev/>

Thanks,
Sherman





More information about the core-libs-dev mailing list