JDK-6499793 : Clean up ZipInputStream.read() with respect to STORED and DEFLATED cases
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 6
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2006-12-01
  • Updated: 2014-01-16
Related Reports
Relates :  
Description
In ZipInputStream.read(), there is an asymmetry between the STORED
and DEFLATED case.  End of file while reading entry data should be
done consistently.

In the DEFLATED case, the crc is checked when entryEOF is set to
true.  The STORED case should probably do likewise.

On the other hand, perhaps the code should do EOF processing
whenever there are no bytes left to read, without waiting for
an unproductive final read that returns -1.

But whatever we do, STORED and DEFLATED should be consistent.

Comments
EVALUATION This bug was filed while reviewing 4879507. The code would be more readily maintained if the two cases were similar.
01-12-2006