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
Fields inherited from class 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 TypeMethodDescriptionintvoidclose()protected voidfinalize()booleanbooleanintread()intread(byte[] dst, int offset, int len) static longstatic longsetContinuous(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) voidsetFinalize(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) setRefMultipleDDicts(boolean useMultiple) Enable or disable support for multiple dictionary referenceslongskip(long numBytes) Methods inherited from class FilterInputStream
mark, read, resetMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
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
-
setRefMultipleDDicts
Enable or disable support for multiple dictionary references- Parameters:
useMultiple- Enables references table for DDict, so the DDict used for decompression will be determined per the dictId in the frame, default: false- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
available
- Overrides:
availablein classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classFilterInputStream
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-