public abstract class NonBlockedDecompressor extends Object implements org.apache.hadoop.io.compress.Decompressor
| Constructor and Description |
|---|
NonBlockedDecompressor() |
| Modifier and Type | Method and Description |
|---|---|
int |
decompress(byte[] buffer,
int off,
int len)
Fills specified buffer with uncompressed data.
|
void |
end() |
boolean |
finished() |
int |
getRemaining() |
protected abstract int |
maxUncompressedLength(ByteBuffer compressed,
int maxUncompressedLength)
Get the maximum uncompressed byte size of the given compressed input.
|
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.
|
protected abstract int |
uncompress(ByteBuffer compressed,
ByteBuffer uncompressed)
Uncompress the content in the input buffer.
|
public int decompress(byte[] buffer,
int off,
int len)
throws IOException
needsInput() should be called in order to determine if more
input data is required.decompress in interface org.apache.hadoop.io.compress.Decompressorbuffer - Buffer for the compressed dataoff - Start offset of the datalen - Size of the bufferIOException - if reading or decompression failspublic void setInput(byte[] buffer,
int off,
int len)
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.)setInput in interface org.apache.hadoop.io.compress.Decompressorbuffer - Input dataoff - Start offsetlen - Lengthpublic void end()
end in interface org.apache.hadoop.io.compress.Decompressorpublic boolean finished()
finished in interface org.apache.hadoop.io.compress.Decompressorpublic int getRemaining()
getRemaining in interface org.apache.hadoop.io.compress.Decompressorpublic boolean needsInput()
needsInput in interface org.apache.hadoop.io.compress.Decompressorpublic void reset()
reset in interface org.apache.hadoop.io.compress.Decompressorpublic boolean needsDictionary()
needsDictionary in interface org.apache.hadoop.io.compress.Decompressorpublic void setDictionary(byte[] b,
int off,
int len)
setDictionary in interface org.apache.hadoop.io.compress.Decompressorprotected abstract int maxUncompressedLength(ByteBuffer compressed, int maxUncompressedLength) throws IOException
compressed - input data [pos() ... limit())maxUncompressedLength - maximum length of the uncompressed dataIOExceptionprotected abstract int uncompress(ByteBuffer compressed, ByteBuffer uncompressed) throws IOException
compressed - buffer[pos() ... limit()) containing the input datauncompressed - output of the the uncompressed data. It uses buffer[pos()..]IOExceptionCopyright © 2023 The Apache Software Foundation. All rights reserved.