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
-
-
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 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 streamZstdBufferDecompressingStreamsetDict(byte[] dict)ZstdBufferDecompressingStreamsetDict(ZstdDictDecompress dict)voidsetFinalize(boolean finalize)Enable or disable class finalizersZstdBufferDecompressingStreamsetLongMax(int windowLogMax)
-
-
-
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:
closein interfacejava.lang.AutoCloseable- 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
-
-