Class ZstdCompressorInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.compress.compressors.CompressorInputStream
-
- org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,InputStreamStatistics
public class ZstdCompressorInputStream extends CompressorInputStream implements InputStreamStatistics
CompressorInputStreamimplementation to decode Zstandard encoded stream. Library relies on Zstandard JNI- Since:
- 1.16
-
-
Constructor Summary
Constructors Constructor Description ZstdCompressorInputStream(java.io.InputStream in)ZstdCompressorInputStream(java.io.InputStream in, com.github.luben.zstd.BufferPool bufferPool)Creates a new input stream that decompresses zstd-compressed data from the specific input stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()longgetCompressedCount()Gets the amount of raw or compressed bytes read by the stream.voidmark(int readLimit)booleanmarkSupported()intread()intread(byte[] b)intread(byte[] buf, int off, int len)voidreset()longskip(long n)java.lang.StringtoString()-
Methods inherited from class org.apache.commons.compress.compressors.CompressorInputStream
getBytesRead, getCount, getUncompressedCount
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.compress.utils.InputStreamStatistics
getUncompressedCount
-
-
-
-
Constructor Detail
-
ZstdCompressorInputStream
public ZstdCompressorInputStream(java.io.InputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
ZstdCompressorInputStream
public ZstdCompressorInputStream(java.io.InputStream in, com.github.luben.zstd.BufferPool bufferPool) throws java.io.IOExceptionCreates a new input stream that decompresses zstd-compressed data from the specific input stream- Parameters:
in- the input stream of compressed databufferPool- a configuration of zstd-jni that allows users to customize how buffers are recycled. Either aNoPoolor aRecyclingBufferPoolis allowed here.- Throws:
java.io.IOException- if an IO error occurs.
-
-
Method Detail
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
getCompressedCount
public long getCompressedCount()
Description copied from interface:InputStreamStatisticsGets 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
public void mark(int readLimit)
- Overrides:
markin classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int off, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException- Overrides:
resetin classjava.io.InputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-