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
  • 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.