## 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, Seekable

Direct Known Subclasses:
  BlockDecompressorStream

    public class DecompressorStream

extends CompressionInputStream

Field Summary
`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
`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
`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
`getPos, seek, seekToNewSource`

Methods inherited from class java.io.InputStream
`read`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### decompressor

    protected Decompressor decompressor

### buffer

    protected byte[] buffer

### eof

    protected boolean eof

### closed

    protected boolean closed

Constructor Detail

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

Method Detail

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

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

Copyright © 2009 The Apache Software Foundation