Release Note: Weaken the InflaterInputStream Specification in Order to Allow Faster Zip Implementations

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Delivered
    • Priority: P4
    • 20
    • Affects Version/s: 20
    • Component/s: core-libs

      The specification of the `read` methods defined by `java.util.zip.InflaterInputStream`,`ZipInputStream`, and `GZIPInputStream` have changed to allow these methods deviate from `InputStream.read` for the case that a “short read” occurs.

      A “short read” is the case where the user provides a buffer with space for M bytes but only N bytes (where 0 < N < M) are read. The long standing specification for `InputStream.read` is that N bytes are stored in the buffer provided by the user and elements at offset off+N to off+M-1 are not changed.

      The deviation allows the `read` method to use the elements at off+N to off+M-1 as temporary storage. Code using these APIs can no longer depend on these elements being unaffected when reading uncompressed data into a byte array.

            Assignee:
            Volker Simonis
            Reporter:
            Volker Simonis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: