Package org.apache.parquet.hadoop.codec
Class SnappyDecompressor
- java.lang.Object
-
- org.apache.parquet.hadoop.codec.SnappyDecompressor
-
- All Implemented Interfaces:
org.apache.hadoop.io.compress.Decompressor
public class SnappyDecompressor extends Object implements org.apache.hadoop.io.compress.Decompressor
-
-
Constructor Summary
Constructors Constructor Description SnappyDecompressor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdecompress(byte[] buffer, int off, int len)Fills specified buffer with uncompressed data.voidend()booleanfinished()intgetRemaining()booleanneedsDictionary()booleanneedsInput()voidreset()voidsetDictionary(byte[] b, int off, int len)voidsetInput(byte[] buffer, int off, int len)Sets input data for decompression.
-
-
-
Method Detail
-
decompress
public int decompress(byte[] buffer, int off, int len) throws IOExceptionFills specified buffer with uncompressed data. Returns actual number of bytes of uncompressed data. A return value of 0 indicates thatneedsInput()should be called in order to determine if more input data is required.- Specified by:
decompressin interfaceorg.apache.hadoop.io.compress.Decompressor- Parameters:
buffer- Buffer for the compressed dataoff- Start offset of the datalen- 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 ifneedsInput()returnstrueindicating that more input data is required. (Both native and non-native versions of various Decompressors require that the data passed in viab[]remain unmodified until the caller is explicitly notified--vianeedsInput()--that the buffer may be safely modified. With this requirement, an extra buffer-copy can be avoided.)- Specified by:
setInputin interfaceorg.apache.hadoop.io.compress.Decompressor- Parameters:
buffer- Input dataoff- Start offsetlen- Length
-
end
public void end()
- Specified by:
endin interfaceorg.apache.hadoop.io.compress.Decompressor
-
finished
public boolean finished()
- Specified by:
finishedin interfaceorg.apache.hadoop.io.compress.Decompressor
-
getRemaining
public int getRemaining()
- Specified by:
getRemainingin interfaceorg.apache.hadoop.io.compress.Decompressor
-
needsInput
public boolean needsInput()
- Specified by:
needsInputin interfaceorg.apache.hadoop.io.compress.Decompressor
-
reset
public void reset()
- Specified by:
resetin interfaceorg.apache.hadoop.io.compress.Decompressor
-
needsDictionary
public boolean needsDictionary()
- Specified by:
needsDictionaryin interfaceorg.apache.hadoop.io.compress.Decompressor
-
setDictionary
public void setDictionary(byte[] b, int off, int len)- Specified by:
setDictionaryin interfaceorg.apache.hadoop.io.compress.Decompressor
-
-