Package org.apache.hadoop.io.compress
Class DecompressorStream
java.lang.Object
java.io.InputStream
org.apache.hadoop.io.compress.CompressionInputStream
org.apache.hadoop.io.compress.DecompressorStream
- All Implemented Interfaces:
Closeable,AutoCloseable,Seekable,org.apache.hadoop.fs.statistics.IOStatisticsSource
- Direct Known Subclasses:
BlockDecompressorStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]protected booleanprotected Decompressorprotected booleanFields inherited from class org.apache.hadoop.io.compress.CompressionInputStream
in, maxAvailableData -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAllow derived classes to directly set the underlying stream.DecompressorStream(InputStream in, Decompressor decompressor) DecompressorStream(InputStream in, Decompressor decompressor, int bufferSize) -
Method Summary
Modifier and TypeMethodDescriptionintprotected voidvoidclose()protected intdecompress(byte[] b, int off, int len) protected intvoidmark(int readlimit) booleanintread()intread(byte[] b, int off, int len) Read bytes from the stream.voidreset()voidReset the decompressor to its initial state and discard any buffered data, as the underlying stream may have been repositioned.longskip(long n) Methods inherited from class org.apache.hadoop.io.compress.CompressionInputStream
getIOStatistics, getPos, seek, seekToNewSourceMethods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
decompressor
-
buffer
protected byte[] buffer -
eof
protected boolean eof -
closed
protected boolean closed
-
-
Constructor Details
-
DecompressorStream
public DecompressorStream(InputStream in, Decompressor decompressor, int bufferSize) throws IOException - Throws:
IOException
-
DecompressorStream
- Throws:
IOException
-
DecompressorStream
Allow derived classes to directly set the underlying stream.- Parameters:
in- Underlying input stream.- Throws:
IOException- raised on errors performing I/O.
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
Description copied from class:CompressionInputStreamRead bytes from the stream. Made abstract to prevent leakage to underlying stream.- Specified by:
readin classCompressionInputStream- Throws:
IOException
-
decompress
- Throws:
IOException
-
getCompressedData
- Throws:
IOException
-
checkStream
- Throws:
IOException
-
resetState
Description copied from class:CompressionInputStreamReset the decompressor to its initial state and discard any buffered data, as the underlying stream may have been repositioned.- Specified by:
resetStatein classCompressionInputStream- Throws:
IOException- raised on errors performing I/O.
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classCompressionInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-