ZlibDecompressor.ZlibDirectDecompressor (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io.compress.zlib, class: ZlibDecompressor, class: ZlibDirectDecompressor

Package org.apache.hadoop.io.compress.zlib

# Class ZlibDecompressor.ZlibDirectDecompressor

java.lang.Object
org.apache.hadoop.io.compress.zlib.ZlibDecompressor
org.apache.hadoop.io.compress.zlib.ZlibDecompressor.ZlibDirectDecompressor

All Implemented Interfaces:
  `Decompressor`, `DirectDecompressor`

Enclosing class:
  ZlibDecompressor

public static class ZlibDecompressor.ZlibDirectDecompressor extends ZlibDecompressor implements DirectDecompressor

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.io.compress.zlib.ZlibDecompressor

  `ZlibDecompressor.CompressionHeader, ZlibDecompressor.ZlibDirectDecompressor`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ZlibDirectDecompressor()`
  `ZlibDirectDecompressor(ZlibDecompressor.CompressionHeader header, int directBufferSize)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `decompress(byte[] b, int off, int len)`
  Fills specified buffer with uncompressed data.
  `void`
  `decompress(ByteBuffer src, ByteBuffer dst)`
  `boolean`
  `finished()`
  Returns `true` if the end of the decompressed data output stream has been reached.
  `void`
  `reset()`
  Resets everything including the input buffers (user and direct).
  `void`
  `setDictionary(byte[] b, int off, int len)`
  Sets preset dictionary for compression.

  ### Methods inherited from class org.apache.hadoop.io.compress.zlib.ZlibDecompressor

  `end, finalize, getBytesRead, getBytesWritten, getRemaining, needsDictionary, needsInput, setInput`

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

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

- ## Constructor Details

  - ### ZlibDirectDecompressor

    public ZlibDirectDecompressor()

  - ### ZlibDirectDecompressor

    public ZlibDirectDecompressor(ZlibDecompressor.CompressionHeader header, int directBufferSize)

- ## Method Details

  - ### finished

    public boolean finished()
    Description copied from interface: `Decompressor`
    Returns `true` if the end of the decompressed data output stream has been reached. Indicates a concatenated data stream when finished() returns `true` and `Decompressor.getRemaining()` returns a positive value. finished() will be reset with the `Decompressor.reset()` method.
    Specified by:
      `finished` in interface `Decompressor`
    Overrides:
      `finished` in class `ZlibDecompressor`
    Returns:
      `true` if the end of the decompressed data output stream has been reached.

  - ### reset

    public void reset()
    Description copied from class: `ZlibDecompressor`
    Resets everything including the input buffers (user and direct).
    Specified by:
      `reset` in interface `Decompressor`
    Overrides:
      `reset` in class `ZlibDecompressor`

  - ### decompress

    public void decompress(ByteBuffer src, ByteBuffer dst) throws IOException
    Specified by:
      `decompress` in interface `DirectDecompressor`
    Throws:
      `IOException`

  - ### setDictionary

    public void setDictionary(byte[] b, int off, int len)
    Description copied from interface: `Decompressor`
    Sets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined.
    Specified by:
      `setDictionary` in interface `Decompressor`
    Overrides:
      `setDictionary` in class `ZlibDecompressor`
    Parameters:
      `b` - Dictionary data bytes
      `off` - Start offset
      `len` - Length

  - ### decompress

    public int decompress(byte[] b, int off, int len)
    Description copied from interface: `Decompressor`
    Fills specified buffer with uncompressed data. Returns actual number of bytes of uncompressed data. A return value of 0 indicates that `Decompressor.needsInput()` should be called in order to determine if more input data is required.
    Specified by:
      `decompress` in interface `Decompressor`
    Overrides:
      `decompress` in class `ZlibDecompressor`
    Parameters:
      `b` - Buffer for the uncompressed data
      `off` - Start offset of the data
      `len` - Size of the buffer
    Returns:
      The actual number of bytes of uncompressed data.