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

Package org.apache.hadoop.io.compress

# Class BlockDecompressorStream

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

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

@Public @Evolving public class BlockDecompressorStream extends DecompressorStream
A `DecompressorStream` which works with 'block-based' based compression algorithms, as opposed to 'stream-based' compression algorithms.

- ## Field Summary

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

  `buffer, closed, decompressor, eof`

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

  `in, maxAvailableData`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `BlockDecompressorStream(InputStream in)`
  ``
  `BlockDecompressorStream(InputStream in, Decompressor decompressor)`
  Create a `BlockDecompressorStream`.
  ``
  `BlockDecompressorStream(InputStream in, Decompressor decompressor, int bufferSize)`
  Create a `BlockDecompressorStream`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected int`
  `decompress(byte[] b, int off, int len)`
  `protected int`
  `getCompressedData()`
  `void`
  `resetState()`
  Reset the decompressor to its initial state and discard any buffered data, as the underlying stream may have been repositioned.

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

  `available, checkStream, close, mark, markSupported, read, read, reset, skip`

  ### 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`

- ## Constructor Details

  - ### BlockDecompressorStream

    public BlockDecompressorStream(InputStream in, Decompressor decompressor, int bufferSize) throws IOException
    Create a `BlockDecompressorStream`.
    Parameters:
      `in` - input stream
      `decompressor` - decompressor to use
      `bufferSize` - size of buffer
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### BlockDecompressorStream

    public BlockDecompressorStream(InputStream in, Decompressor decompressor) throws IOException
    Create a `BlockDecompressorStream`.
    Parameters:
      `in` - input stream
      `decompressor` - decompressor to use
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### BlockDecompressorStream

    protected BlockDecompressorStream(InputStream in) throws IOException
    Throws:
      `IOException`

- ## Method Details

  - ### decompress

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

  - ### getCompressedData

    protected int getCompressedData() throws IOException
    Overrides:
      `getCompressedData` in class `DecompressorStream`
    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.
    Overrides:
      `resetState` in class `DecompressorStream`
    Throws:
      `IOException` - raised on errors performing I/O.