Class ZstdCompressorInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.compress.compressors.CompressorInputStream
org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable,InputStreamStatistics
public class ZstdCompressorInputStream
extends CompressorInputStream
implements InputStreamStatistics
CompressorInputStream implementation to decode Zstandard encoded stream.
This class avoids making the underlying zstd classes part of the public or protected API. The underlying implementation is provided through the
Zstandard JNI library which is based on zstd.
- Since:
- 1.16
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new input stream that decompresses zstd-compressed data from the specific input stream.ZstdCompressorInputStream(InputStream in, com.github.luben.zstd.BufferPool bufferPool) Constructs a new input stream that decompresses zstd-compressed data from the specific input stream. -
Method Summary
Methods inherited from class org.apache.commons.compress.compressors.CompressorInputStream
count, count, getBytesRead, getCount, getUncompressedCount, pushedBackBytesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.compress.utils.InputStreamStatistics
getUncompressedCount
-
Constructor Details
-
ZstdCompressorInputStream
Constructs a new input stream that decompresses zstd-compressed data from the specific input stream.- Parameters:
in- the input stream of compressed data.- Throws:
IOException- if an I/O error occurs.
-
ZstdCompressorInputStream
public ZstdCompressorInputStream(InputStream in, com.github.luben.zstd.BufferPool bufferPool) throws IOException Constructs a new input stream that decompresses zstd-compressed data from the specific input stream.- Parameters:
in- the input stream of compressed data.bufferPool- a configuration of zstd-jni that allows users to customize how buffers are recycled. Either aNoPoolor aRecyclingBufferPoolis allowed here.- Throws:
IOException- if an I/O error occurs.
-
-
Method Details
-
available
- Overrides:
availablein classInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
getCompressedCount
Gets the amount of raw or compressed bytes read by the stream.- Specified by:
getCompressedCountin interfaceInputStreamStatistics- Returns:
- the amount of raw or compressed bytes read by the stream.
- Since:
- 1.17
-
mark
- Overrides:
markin classInputStream
-
markSupported
- Overrides:
markSupportedin classInputStream
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
toString
-