Package com.github.luben.zstd
Class ZstdDirectBufferDecompressingStream
- java.lang.Object
-
- com.github.luben.zstd.ZstdDirectBufferDecompressingStream
-
- All Implemented Interfaces:
java.io.Closeable
public class ZstdDirectBufferDecompressingStream extends java.lang.Object implements java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description ZstdDirectBufferDecompressingStream(java.nio.ByteBuffer source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidfinalize()booleanhasRemaining()intread(java.nio.ByteBuffer target)static intrecommendedTargetBufferSize()protected java.nio.ByteBufferrefill(java.nio.ByteBuffer toRefill)Override this method in case the byte buffer passed to the constructor might not contain the full compressed streamZstdDirectBufferDecompressingStreamsetDict(byte[] dict)ZstdDirectBufferDecompressingStreamsetDict(ZstdDictDecompress dict)voidsetFinalize(boolean finalize)Enable or disable class finalizers If finalizers are disabled the responsibility fir calling the `close` method is on the consumer.
-
-
-
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 finalizers If 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 ZstdDirectBufferDecompressingStream setDict(byte[] dict) throws java.io.IOException
- Throws:
java.io.IOException
-
setDict
public ZstdDirectBufferDecompressingStream setDict(ZstdDictDecompress dict) 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:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-