@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class CompressionInputStream extends InputStream implements Seekable, org.apache.hadoop.fs.statistics.IOStatisticsSource
Implementations are assumed to be buffered. This permits clients to
reposition the underlying input stream then call resetState()
,
without having to also synchronize client buffers.
Modifier and Type | Field and Description |
---|---|
protected InputStream |
in
The input stream to be compressed.
|
protected long |
maxAvailableData |
Modifier | Constructor and Description |
---|---|
protected |
CompressionInputStream(InputStream in)
Create a compression input stream that reads
the decompressed bytes from the given stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
IOStatistics |
getIOStatistics()
Return any IOStatistics provided by the underlying stream.
|
long |
getPos()
This method returns the current position in the stream.
|
abstract int |
read(byte[] b,
int off,
int len)
Read bytes from the stream.
|
abstract void |
resetState()
Reset the decompressor to its initial state and discard any buffered data,
as the underlying stream may have been repositioned.
|
void |
seek(long pos)
This method is current not supported.
|
boolean |
seekToNewSource(long targetPos)
This method is current not supported.
|
available, mark, markSupported, read, read, reset, skip
protected final InputStream in
protected long maxAvailableData
protected CompressionInputStream(InputStream in) throws IOException
in
- The input stream to be compressed.IOException
- raised on errors performing I/O.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public IOStatistics getIOStatistics()
getIOStatistics
in interface org.apache.hadoop.fs.statistics.IOStatisticsSource
public abstract int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public abstract void resetState() throws IOException
IOException
- raised on errors performing I/O.public long getPos() throws IOException
getPos
in interface Seekable
IOException
- raised on errors performing I/O.public void seek(long pos) throws UnsupportedOperationException
seek
in interface Seekable
pos
- offset from the start of the file.UnsupportedOperationException
- Unsupported Operation Exception.public boolean seekToNewSource(long targetPos) throws UnsupportedOperationException
UnsupportedOperationException
- Unsupported Operation Exception.Copyright © 2024 Apache Software Foundation. All rights reserved.