Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6449882

ZipExceptions when reusing ZipEntry objects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0u7
    • core-libs
    • None

      In JDK 1.5.0 Update 7, it is not possible to use
      ZipOutputStream.putNextEntry(new ZipEntry(ze)), if the object "ze" has been used in a different Zip stream with different compression level. If one tries to do this, a java.util.zip.ZipException is
      thrown with message text "invalid entry compressed size (expected 22 but got 25 bytes)".

      One soln that worked is to use ZipOutputStream.putNextEntry(new ZipEntry(ze.getName())) instad. But the ISV would like to know when the original problem will be solved.

      The attached sample program ZipEntryProblem.java illustrates the problem.

            Unassigned Unassigned
            vabhat Vasanth Bhat
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: