java.io.Closeable, java.lang.AutoCloseable, Seekable, IOStatisticsSourceDecompressorStream, SplitCompressionInputStream@Public @Evolving public abstract class CompressionInputStream extends java.io.InputStream implements Seekable, 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 | Description |
|---|---|---|
protected java.io.InputStream |
in |
The input stream to be compressed.
|
protected long |
maxAvailableData |
| Modifier | Constructor | Description |
|---|---|---|
protected |
CompressionInputStream(java.io.InputStream in) |
Create a compression input stream that reads
the decompressed bytes from the given stream.
|
| Modifier and Type | Method | 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.
|
protected final java.io.InputStream in
protected long maxAvailableData
protected CompressionInputStream(java.io.InputStream in)
throws java.io.IOException
in - The input stream to be compressed.java.io.IOException - raised on errors performing I/O.public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOExceptionpublic IOStatistics getIOStatistics()
getIOStatistics in interface IOStatisticsSourcepublic abstract int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic abstract void resetState()
throws java.io.IOException
java.io.IOException - raised on errors performing I/O.public long getPos()
throws java.io.IOException
public void seek(long pos)
throws java.lang.UnsupportedOperationException
public boolean seekToNewSource(long targetPos)
throws java.lang.UnsupportedOperationException
seekToNewSource in interface SeekabletargetPos - target position.java.lang.UnsupportedOperationException - Unsupported Operation Exception.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.