org.apache.commons.compress.compressors.zstandard

## Class ZstdCompressorInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.commons.compress.compressors.CompressorInputStream
    - - org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream

- All Implemented Interfaces:
    Closeable, AutoCloseable, InputStreamStatistics

      public class ZstdCompressorInputStream
      extends CompressorInputStream
      implements InputStreamStatistics

  `CompressorInputStream` implementation to decode Zstandard encoded stream. Library relies on Zstandard JNI
  Since:
    1.16

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ZstdCompressorInputStream(InputStream in)`
    `ZstdCompressorInputStream(InputStream in, com.github.luben.zstd.BufferPool bufferPool)` Creates a new input stream that decompresses zstd-compressed data from the specific input stream

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `close()`
    `long` | `getCompressedCount()`
    `void` | `mark(int readlimit)`
    `boolean` | `markSupported()`
    `int` | `read()`
    `int` | `read(byte[] b)`
    `int` | `read(byte[] buf, int off, int len)`
    `void` | `reset()`
    `long` | `skip(long n)`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.commons.compress.compressors.CompressorInputStream

      `count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytes`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.commons.compress.utils.InputStreamStatistics

      `getUncompressedCount`

- - ### Constructor Detail

    - #### ZstdCompressorInputStream

          public ZstdCompressorInputStream(InputStream in)
                                    throws IOException

      Throws:
        `IOException`

    - #### ZstdCompressorInputStream

          public ZstdCompressorInputStream(InputStream in,
                                           com.github.luben.zstd.BufferPool bufferPool)
                                    throws IOException

      Creates a new input stream that decompresses zstd-compressed data from the specific input stream
      Parameters:
        `in` - the input stream of compressed data
        `bufferPool` - a configuration of zstd-jni that allows users to customize how buffers are recycled. Either a `NoPool` or a `RecyclingBufferPool` is allowed here.
      Throws:
        `IOException` - if an IO error occurs.

  - ### Method Detail

    - #### available

          public int available()
                        throws IOException

      Overrides:
        `available` in class `InputStream`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Overrides:
        `close` in class `InputStream`
      Throws:
        `IOException`

    - #### getCompressedCount

          public long getCompressedCount()

      Specified by:
        `getCompressedCount` in interface `InputStreamStatistics`
      Returns:
        the amount of raw or compressed bytes read by the stream
      Since:
        1.17

    - #### mark

          public void mark(int readlimit)

      Overrides:
        `mark` in class `InputStream`

    - #### markSupported

          public boolean markSupported()

      Overrides:
        `markSupported` in class `InputStream`

    - #### read

          public int read()
                   throws IOException

      Specified by:
        `read` in class `InputStream`
      Throws:
        `IOException`

    - #### read

          public int read(byte[] b)
                   throws IOException

      Overrides:
        `read` in class `InputStream`
      Throws:
        `IOException`

    - #### read

          public int read(byte[] buf,
                          int off,
                          int len)
                   throws IOException

      Overrides:
        `read` in class `InputStream`
      Throws:
        `IOException`

    - #### reset

          public void reset()
                     throws IOException

      Overrides:
        `reset` in class `InputStream`
      Throws:
        `IOException`

    - #### skip

          public long skip(long n)
                    throws IOException

      Overrides:
        `skip` in class `InputStream`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.