Package com.github.luben.zstd
Class ZstdInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.github.luben.zstd.ZstdInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
InputStream filter that decompresses the data provided
by the underlying InputStream using Zstd compression.
It does not support mark/reset methods
-
Field Summary
FieldsFields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorsConstructorDescriptionZstdInputStream
(InputStream inStream) create a new decompressing InputStreamZstdInputStream
(InputStream inStream, BufferPool bufferPool) create a new decompressing InputStream -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
protected void
finalize()
boolean
boolean
int
read()
int
read
(byte[] dst, int offset, int len) static long
static long
setContinuous
(boolean b) Don't break on unfinished frames Use case: decompressing files that are not yet finished writing and compressingsetDict
(byte[] dict) setDict
(ZstdDictDecompress dict) void
setFinalize
(boolean finalize) Deprecated.If you don't rely on finalizers, use `ZstdInputStreamNoFinalizer` instead, instances of `ZstdInputStream` will always try to close/release in the finalizer.setLongMax
(int windowLogMax) long
skip
(long numBytes) Methods inherited from class java.io.FilterInputStream
mark, read, reset
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
inner
-
-
Constructor Details
-
ZstdInputStream
create a new decompressing InputStream- Parameters:
inStream
- the stream to wrap- Throws:
IOException
-
ZstdInputStream
create a new decompressing InputStream- Parameters:
inStream
- the stream to wrapbufferPool
- the pool to fetch and return buffers- Throws:
IOException
-
-
Method Details
-
setFinalize
Deprecated.If you don't rely on finalizers, use `ZstdInputStreamNoFinalizer` instead, instances of `ZstdInputStream` will always try to close/release in the finalizer.Enable or disable class finalizers- Parameters:
finalize
- default `true` - finalizers are enabled
-
finalize
-
recommendedDInSize
public static long recommendedDInSize() -
recommendedDOutSize
public static long recommendedDOutSize() -
setContinuous
Don't break on unfinished frames Use case: decompressing files that are not yet finished writing and compressing -
getContinuous
public boolean getContinuous() -
setDict
- Throws:
IOException
-
setDict
- Throws:
IOException
-
setLongMax
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
available
- Overrides:
available
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classFilterInputStream
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-