Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8253952 Refine ZipOutputStream.putNextEntry() to recalculate ZipEntry's compressed size
  3. JDK-8254840

Release Note: Refine ZipOutputStream.putNextEntry() to Recalculate ZipEntry's Compressed Size

XMLWordPrintable

      Prior to JDK 16, `ZipOutputStream.putnextEntry()` would not recalculate the compressed size for a compressed (DEFLATED) entry. This could result in the ZipException, "invalid entry compressed size", being thrown if the current ZLIB implementation being used when `ZipOutputStream.putNextEntry()` was called differed from the implementation at the time when the entry was added to the original ZIP file.

      Starting with JDK 16, if the compressed size has not been explicitly set with the `ZipEntry.setCompressedSize(long)` method when writing a compressed (DEFLATED) entry, then the compressed size is set to the actual compressed size after deflation.

            simonis Volker Simonis
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: