Package com.github.luben.zstd
Class ZstdDirectBufferDecompressingStreamNoFinalizer
java.lang.Object
com.github.luben.zstd.ZstdDirectBufferDecompressingStreamNoFinalizer
- All Implemented Interfaces:
Closeable
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private boolean
private int
private ByteBuffer
private final long
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private static long
private long
decompressStream
(long stream, ByteBuffer dst, int dstOffset, int dstSize, ByteBuffer src, int srcOffset, int srcSize) private static long
freeDStream
(long stream) boolean
private long
initDStream
(long stream) int
read
(ByteBuffer target) private static long
static int
protected ByteBuffer
refill
(ByteBuffer toRefill) Override this method in case the byte buffer passed to the constructor might not contain the full compressed streamsetDict
(byte[] dict) setDict
(ZstdDictDecompress dict)
-
Field Details
-
source
-
stream
private final long stream -
finishedFrame
private boolean finishedFrame -
closed
private boolean closed -
streamEnd
private boolean streamEnd -
consumed
private int consumed -
produced
private int produced
-
-
Constructor Details
-
ZstdDirectBufferDecompressingStreamNoFinalizer
-
-
Method Details
-
refill
Override this method in case the byte buffer passed to the constructor might not contain the full compressed stream- Parameters:
toRefill
- current buffer- Returns:
- either the current buffer (but refilled and flipped if there was new content) or a new buffer.
-
recommendedDOutSize
private static long recommendedDOutSize() -
createDStream
private static long createDStream() -
freeDStream
private static long freeDStream(long stream) -
initDStream
private long initDStream(long stream) -
decompressStream
private long decompressStream(long stream, ByteBuffer dst, int dstOffset, int dstSize, ByteBuffer src, int srcOffset, int srcSize) -
hasRemaining
public boolean hasRemaining() -
recommendedTargetBufferSize
public static int recommendedTargetBufferSize() -
setDict
- Throws:
IOException
-
setDict
public ZstdDirectBufferDecompressingStreamNoFinalizer setDict(ZstdDictDecompress dict) throws IOException - Throws:
IOException
-
read
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-