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
CompressorInputStream
implementation 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 int
available()
void
close()
long
getCompressedCount()
Gets the amount of raw or compressed bytes read by the stream.void
mark(int readLimit)
boolean
markSupported()
int
read()
int
read(byte[] b)
int
read(byte[] buf, int off, int len)
void
reset()
long
skip(long n)
java.lang.String
toString()
-
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.IOException
Creates 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 aNoPool
or aRecyclingBufferPool
is allowed here.- Throws:
java.io.IOException
- if an IO error occurs.
-
-
Method Detail
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
getCompressedCount
public long getCompressedCount()
Description copied from interface:InputStreamStatistics
Gets the amount of raw or compressed bytes read by the stream.- Specified by:
getCompressedCount
in interfaceInputStreamStatistics
- Returns:
- the amount of raw or compressed bytes read by the stream.
- Since:
- 1.17
-
mark
public void mark(int readLimit)
- Overrides:
mark
in classjava.io.InputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.InputStream
-
read
public int read() throws java.io.IOException
- Specified by:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-