Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-685

Javadoc for GzipCompressorInputStream contains inaccuracies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.26.2
    • 1.27.0
    • Compressors
    • None

    Description

      There are two incorrect statements in the Javadoc for GzipCompressorInputStream:

      If you use the constructor GzipCompressorInputStream(in) or GzipCompressorInputStream(in, false) with some InputStream in then read() will return -1 as soon as the first internal member has been read completely. The stream in will be positioned at the start of the second gzip member if there is one.

      That statement is only true if the configured input stream supports mark()/reset().

      Otherwise not, an IOException may be thrown if/when reset() is invoked on the input stream (or maybe not if you get lucky and the stars and read buffering align).

      GZIPInputStream doesn't decompress concatenated .gz files: it stops after the first member and silently ignores the rest.

      That statement was true a long time ago but is no longer true. This support was added in JDK 7 (see JDK-4691425).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              archie172 Archie Cobbs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: