Class XZCompressorInputStream

java.lang.Object
java.io.InputStream
org.apache.commons.compress.compressors.CompressorInputStream
org.apache.commons.compress.compressors.xz.XZCompressorInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, InputStreamStatistics

XZ decompressor.

For example:


 XZCompressorInputStream s = XZCompressorInputStream.builder()
   .setPath(path)
   .setDecompressConcatenated(false)
   .setMemoryLimitKiB(-1)
   .get();
 
 
Since:
1.4
  • Constructor Details

    • XZCompressorInputStream

      public XZCompressorInputStream(InputStream inputStream) throws IOException
      Creates a new input stream that decompresses XZ-compressed data from the specified input stream. This doesn't support concatenated .xz files.
      Parameters:
      inputStream - where to read the compressed data
      Throws:
      IOException - if the input is not in the .xz format, the input is corrupt or truncated, the .xz headers specify options that are not supported by this implementation, or the underlying inputStream throws an exception
    • XZCompressorInputStream

      @Deprecated public XZCompressorInputStream(InputStream inputStream, boolean decompressConcatenated) throws IOException
      Deprecated.
      Creates a new input stream that decompresses XZ-compressed data from the specified input stream.
      Parameters:
      inputStream - where to read the compressed data
      decompressConcatenated - if true, decompress until the end of the input; if false, stop after the first .xz stream and leave the input position to point to the next byte after the .xz stream
      Throws:
      IOException - if the input is not in the .xz format, the input is corrupt or truncated, the .xz headers specify options that are not supported by this implementation, or the underlying inputStream throws an exception
    • XZCompressorInputStream

      @Deprecated public XZCompressorInputStream(InputStream inputStream, boolean decompressConcatenated, int memoryLimitKiB) throws IOException
      Deprecated.
      Creates a new input stream that decompresses XZ-compressed data from the specified input stream.
      Parameters:
      inputStream - where to read the compressed data
      decompressConcatenated - if true, decompress until the end of the input; if false, stop after the first .xz stream and leave the input position to point to the next byte after the .xz stream
      memoryLimitKiB - The memory limit used when reading blocks. The memory usage limit is expressed in kibibytes (KiB) or -1 to impose no memory usage limit. If the estimated memory limit is exceeded on read(), a MemoryLimitException is thrown.
      Throws:
      IOException - if the input is not in the .xz format, the input is corrupt or truncated, the .xz headers specify options that are not supported by this implementation, or the underlying inputStream throws an exception
      Since:
      1.14
  • Method Details