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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.io.compress.zlib.ZlibDecompressor
ZlibDecompressor.CompressionHeader, ZlibDecompressor.ZlibDirectDecompressor -
Constructor Summary
ConstructorsConstructorDescriptionZlibDirectDecompressor(ZlibDecompressor.CompressionHeader header, int directBufferSize) -
Method Summary
Modifier and TypeMethodDescriptionintdecompress(byte[] b, int off, int len) Fills specified buffer with uncompressed data.voiddecompress(ByteBuffer src, ByteBuffer dst) booleanfinished()Returnstrueif the end of the decompressed data output stream has been reached.voidreset()Resets everything including the input buffers (user and direct).voidsetDictionary(byte[] b, int off, int len) Sets preset dictionary for compression.Methods inherited from class org.apache.hadoop.io.compress.zlib.ZlibDecompressor
end, finalize, getBytesRead, getBytesWritten, getRemaining, needsDictionary, needsInput, setInput
-
Constructor Details
-
ZlibDirectDecompressor
public ZlibDirectDecompressor() -
ZlibDirectDecompressor
-
-
Method Details
-
finished
public boolean finished()Description copied from interface:DecompressorReturnstrueif the end of the decompressed data output stream has been reached. Indicates a concatenated data stream when finished() returnstrueandDecompressor.getRemaining()returns a positive value. finished() will be reset with theDecompressor.reset()method.- Specified by:
finishedin interfaceDecompressor- Overrides:
finishedin classZlibDecompressor- Returns:
trueif the end of the decompressed data output stream has been reached.
-
reset
public void reset()Description copied from class:ZlibDecompressorResets everything including the input buffers (user and direct).- Specified by:
resetin interfaceDecompressor- Overrides:
resetin classZlibDecompressor
-
decompress
- Specified by:
decompressin interfaceDirectDecompressor- Throws:
IOException
-
setDictionary
public void setDictionary(byte[] b, int off, int len) Description copied from interface:DecompressorSets preset dictionary for compression. A preset dictionary is used when the history buffer can be predetermined.- Specified by:
setDictionaryin interfaceDecompressor- Overrides:
setDictionaryin classZlibDecompressor- Parameters:
b- Dictionary data bytesoff- Start offsetlen- Length
-
decompress
public int decompress(byte[] b, int off, int len) Description copied from interface:DecompressorFills specified buffer with uncompressed data. Returns actual number of bytes of uncompressed data. A return value of 0 indicates thatDecompressor.needsInput()should be called in order to determine if more input data is required.- Specified by:
decompressin interfaceDecompressor- Overrides:
decompressin classZlibDecompressor- Parameters:
b- Buffer for the uncompressed dataoff- Start offset of the datalen- Size of the buffer- Returns:
- The actual number of bytes of uncompressed data.
-