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

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P4
    • Resolution: Delivered
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: core-libs

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: