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 int
decompress(byte[] buffer, int off, int len)
Fills specified buffer with uncompressed data.void
end()
boolean
finished()
int
getRemaining()
boolean
needsDictionary()
boolean
needsInput()
void
reset()
void
setDictionary(byte[] b, int off, int len)
void
setInput(byte[] buffer, int off, int len)
Sets input data for decompression.
-
-
-
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 thatneedsInput()
should be called in order to determine if more input data is required.- Specified by:
decompress
in 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()
returnstrue
indicating 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:
setInput
in interfaceorg.apache.hadoop.io.compress.Decompressor
- Parameters:
buffer
- Input dataoff
- Start offsetlen
- Length
-
end
public void end()
- Specified by:
end
in interfaceorg.apache.hadoop.io.compress.Decompressor
-
finished
public boolean finished()
- Specified by:
finished
in interfaceorg.apache.hadoop.io.compress.Decompressor
-
getRemaining
public int getRemaining()
- Specified by:
getRemaining
in interfaceorg.apache.hadoop.io.compress.Decompressor
-
needsInput
public boolean needsInput()
- Specified by:
needsInput
in interfaceorg.apache.hadoop.io.compress.Decompressor
-
reset
public void reset()
- Specified by:
reset
in interfaceorg.apache.hadoop.io.compress.Decompressor
-
needsDictionary
public boolean needsDictionary()
- Specified by:
needsDictionary
in interfaceorg.apache.hadoop.io.compress.Decompressor
-
setDictionary
public void setDictionary(byte[] b, int off, int len)
- Specified by:
setDictionary
in interfaceorg.apache.hadoop.io.compress.Decompressor
-
-