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

writing 7z entries with LZMA2 fails when closing the stream

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: Archivers
    • Labels:

      Description

      closing archive entries that use LZMA2 compression fails on JDK8 early access build 113 due to:

      org.tukaani.xz.XZIOException: Stream finished or closed
      	at org.tukaani.xz.LZMA2OutputStream.flush(Unknown Source)
      	at java.io.FilterOutputStream.flush(FilterOutputStream.java:140)
      	at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
      	at org.apache.commons.compress.archivers.sevenz.LZMA2Decoder$FinishOnCloseStream.close(LZMA2Decoder.java:67)
      	at java.io.FilterOutputStream.close(FilterOutputStream.java:159)
      	at org.apache.commons.compress.archivers.sevenz.SevenZOutputFile.closeArchiveEntry(SevenZOutputFile.java:125)
      

      Actually there is no need to explicitly finish the wrapped stream as XZ for Java's LZMA2OutputStream which is returned by LZMA2Options#getOutputStream wll internally finish the stream when close is called.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bodewig Stefan Bodewig
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: