DecompressorStream (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io.compress, class: DecompressorStream

Package org.apache.hadoop.io.compress

# Class DecompressorStream

java.lang.Object
java.io.InputStream
org.apache.hadoop.io.compress.CompressionInputStream
org.apache.hadoop.io.compress.DecompressorStream

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Seekable`, `org.apache.hadoop.fs.statistics.IOStatisticsSource`

Direct Known Subclasses:
  `BlockDecompressorStream`

@Public @Evolving public class DecompressorStream extends CompressionInputStream

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected byte[]`
  `buffer`
  `protected boolean`
  `closed`
  `protected Decompressor`
  `decompressor`
  `protected boolean`
  `eof`

  ### Fields inherited from class org.apache.hadoop.io.compress.CompressionInputStream

  `in, maxAvailableData`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `DecompressorStream(InputStream in)`
  Allow derived classes to directly set the underlying stream.
  ``
  `DecompressorStream(InputStream in, Decompressor decompressor)`
  ``
  `DecompressorStream(InputStream in, Decompressor decompressor, int bufferSize)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `available()`
  `protected void`
  `checkStream()`
  `void`
  `close()`
  `protected int`
  `decompress(byte[] b, int off, int len)`
  `protected int`
  `getCompressedData()`
  `void`
  `mark(int readlimit)`
  `boolean`
  `markSupported()`
  `int`
  `read()`
  `int`
  `read(byte[] b, int off, int len)`
  Read bytes from the stream.
  `void`
  `reset()`
  `void`
  `resetState()`
  Reset the decompressor to its initial state and discard any buffered data, as the underlying stream may have been repositioned.
  `long`
  `skip(long n)`

  ### Methods inherited from class org.apache.hadoop.io.compress.CompressionInputStream

  `getIOStatistics, getPos, seek, seekToNewSource`

  ### Methods inherited from class java.io.InputStream

  `nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo`

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

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

- ## Field Details

  - ### decompressor

    protected Decompressor decompressor

  - ### buffer

    protected byte[] buffer

  - ### eof

    protected boolean eof

  - ### closed

    protected boolean closed

- ## Constructor Details

  - ### DecompressorStream

    public DecompressorStream(InputStream in, Decompressor decompressor, int bufferSize) throws IOException
    Throws:
      `IOException`

  - ### DecompressorStream

    public DecompressorStream(InputStream in, Decompressor decompressor) throws IOException
    Throws:
      `IOException`

  - ### DecompressorStream

    protected DecompressorStream(InputStream in) throws IOException
    Allow derived classes to directly set the underlying stream.
    Parameters:
      `in` - Underlying input stream.
    Throws:
      `IOException` - raised on errors performing I/O.

- ## Method Details

  - ### read

    public int read() throws IOException
    Specified by:
      `read` in class `InputStream`
    Throws:
      `IOException`

  - ### read

    public int read(byte[] b, int off, int len) throws IOException
    Description copied from class: `CompressionInputStream`
    Read bytes from the stream. Made abstract to prevent leakage to underlying stream.
    Specified by:
      `read` in class `CompressionInputStream`
    Throws:
      `IOException`

  - ### decompress

    protected int decompress(byte[] b, int off, int len) throws IOException
    Throws:
      `IOException`

  - ### getCompressedData

    protected int getCompressedData() throws IOException
    Throws:
      `IOException`

  - ### checkStream

    protected void checkStream() throws IOException
    Throws:
      `IOException`

  - ### resetState

    public void resetState() throws IOException
    Description copied from class: `CompressionInputStream`
    Reset the decompressor to its initial state and discard any buffered data, as the underlying stream may have been repositioned.
    Specified by:
      `resetState` in class `CompressionInputStream`
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### skip

    public long skip(long n) throws IOException
    Overrides:
      `skip` in class `InputStream`
    Throws:
      `IOException`

  - ### available

    public int available() throws IOException
    Overrides:
      `available` in class `InputStream`
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Overrides:
      `close` in class `CompressionInputStream`
    Throws:
      `IOException`

  - ### markSupported

    public boolean markSupported()
    Overrides:
      `markSupported` in class `InputStream`

  - ### mark

    public void mark(int readlimit)
    Overrides:
      `mark` in class `InputStream`

  - ### reset

    public void reset() throws IOException
    Overrides:
      `reset` in class `InputStream`
    Throws:
      `IOException`