Class SnappyDecompressor

  • All Implemented Interfaces:
    org.apache.hadoop.io.compress.Decompressor

    public class SnappyDecompressor
    extends Object
    implements org.apache.hadoop.io.compress.Decompressor
    • Constructor Detail

      • SnappyDecompressor

        public SnappyDecompressor()
    • Method Detail

      • decompress

        public int decompress​(byte[] buffer,
                              int off,
                              int len)
                       throws IOException
        Fills specified buffer with uncompressed data. Returns actual number of bytes of uncompressed data. A return value of 0 indicates that needsInput() should be called in order to determine if more input data is required.
        Specified by:
        decompress in interface org.apache.hadoop.io.compress.Decompressor
        Parameters:
        buffer - Buffer for the compressed data
        off - Start offset of the data
        len - Size of the buffer
        Returns:
        The actual number of bytes of uncompressed data.
        Throws:
        IOException - if reading or decompression fails
      • setInput

        public void setInput​(byte[] buffer,
                             int off,
                             int len)
        Sets input data for decompression. This should be called if and only if needsInput() returns true indicating that more input data is required. (Both native and non-native versions of various Decompressors require that the data passed in via b[] remain unmodified until the caller is explicitly notified--via needsInput()--that the buffer may be safely modified. With this requirement, an extra buffer-copy can be avoided.)
        Specified by:
        setInput in interface org.apache.hadoop.io.compress.Decompressor
        Parameters:
        buffer - Input data
        off - Start offset
        len - Length
      • end

        public void end()
        Specified by:
        end in interface org.apache.hadoop.io.compress.Decompressor
      • finished

        public boolean finished()
        Specified by:
        finished in interface org.apache.hadoop.io.compress.Decompressor
      • getRemaining

        public int getRemaining()
        Specified by:
        getRemaining in interface org.apache.hadoop.io.compress.Decompressor
      • needsInput

        public boolean needsInput()
        Specified by:
        needsInput in interface org.apache.hadoop.io.compress.Decompressor
      • reset

        public void reset()
        Specified by:
        reset in interface org.apache.hadoop.io.compress.Decompressor
      • needsDictionary

        public boolean needsDictionary()
        Specified by:
        needsDictionary in interface org.apache.hadoop.io.compress.Decompressor
      • setDictionary

        public void setDictionary​(byte[] b,
                                  int off,
                                  int len)
        Specified by:
        setDictionary in interface org.apache.hadoop.io.compress.Decompressor