Package com.github.luben.zstd
Class ZstdBufferDecompressingStream
- java.lang.Object
-
- com.github.luben.zstd.ZstdBufferDecompressingStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ZstdBufferDecompressingStream extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
finalize
private ZstdBufferDecompressingStreamNoFinalizer
inner
-
Constructor Summary
Constructors Constructor Description ZstdBufferDecompressingStream(java.nio.ByteBuffer source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
finalize()
boolean
hasRemaining()
int
read(java.nio.ByteBuffer target)
static int
recommendedTargetBufferSize()
protected java.nio.ByteBuffer
refill(java.nio.ByteBuffer toRefill)
Override this method in case the byte buffer passed to the constructor might not contain the full compressed streamZstdBufferDecompressingStream
setDict(byte[] dict)
ZstdBufferDecompressingStream
setDict(ZstdDictDecompress dict)
void
setFinalize(boolean finalize)
Enable or disable class finalizersZstdBufferDecompressingStream
setLongMax(int windowLogMax)
-
-
-
Field Detail
-
inner
private final ZstdBufferDecompressingStreamNoFinalizer inner
-
finalize
private boolean finalize
-
-
Method Detail
-
refill
protected java.nio.ByteBuffer refill(java.nio.ByteBuffer toRefill)
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.
-
setFinalize
public void setFinalize(boolean finalize)
Enable or disable class finalizersIf finalizers are disabled the responsibility fir calling the `close` method is on the consumer.
- Parameters:
finalize
- default `true` - finalizers are enabled
-
hasRemaining
public boolean hasRemaining()
-
recommendedTargetBufferSize
public static int recommendedTargetBufferSize()
-
setDict
public ZstdBufferDecompressingStream setDict(byte[] dict) throws java.io.IOException
- Throws:
java.io.IOException
-
setDict
public ZstdBufferDecompressingStream setDict(ZstdDictDecompress dict) throws java.io.IOException
- Throws:
java.io.IOException
-
setLongMax
public ZstdBufferDecompressingStream setLongMax(int windowLogMax) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public int read(java.nio.ByteBuffer target) throws java.io.IOException
- 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
- Throws:
java.io.IOException
-
finalize
protected void finalize() throws java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
-