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

ZIP entry copy without recompression

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • None
    • core-libs
    • None

      As per Eirik's PR:

      https://github.com/openjdk/jdk/pull/12099

      ===
      A common use case for java.util.zip in build tools involves copying entries from a ZipFile or ZipInputStream to a ZipOutputStream without actually modifying the data.

      Inflating an entry just to immediately deflate it again with no modifications seems wasteful.

      This PR introduces ZipFileInflaterInputStream.transferTo which copies compressed data directly to ZipOutputStreams raw data stream.

      I'm typically seeing a 15 X improvement when copying xalan.jar to a ZipOutputStream backed by a buffered file OutputStream, or 22 X when backed by OutputStream.nullOutputStream().

      ===

            jpai Jaikiran Pai
            coffeys Sean Coffey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: