public class ZstdDirectBufferCompressingStream
extends java.lang.Object
implements java.io.Closeable, java.io.Flushable
| Constructor and Description |
|---|
ZstdDirectBufferCompressingStream(java.nio.ByteBuffer target,
int level) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
compress(java.nio.ByteBuffer source) |
protected void |
finalize() |
void |
flush() |
protected java.nio.ByteBuffer |
flushBuffer(java.nio.ByteBuffer toFlush)
This method should flush the buffer and either return the same buffer (but cleared) or a new buffer
that should be used from then on.
|
static int |
recommendedOutputBufferSize() |
ZstdDirectBufferCompressingStream |
setDict(byte[] dict) |
ZstdDirectBufferCompressingStream |
setDict(ZstdDictCompress dict) |
void |
setFinalize(boolean finalize)
Enable or disable class finalizers
If finalizers are disabled the responsibility fir calling the `close` method is on the consumer.
|
public ZstdDirectBufferCompressingStream(java.nio.ByteBuffer target,
int level)
throws java.io.IOException
java.io.IOExceptionprotected java.nio.ByteBuffer flushBuffer(java.nio.ByteBuffer toFlush)
throws java.io.IOException
toFlush - buffer that has to be flushed (or most cases, you want to call Buffer.flip() first)Buffer.clear().java.io.IOExceptionpublic static int recommendedOutputBufferSize()
public ZstdDirectBufferCompressingStream setDict(byte[] dict) throws java.io.IOException
java.io.IOExceptionpublic ZstdDirectBufferCompressingStream setDict(ZstdDictCompress dict) throws java.io.IOException
java.io.IOExceptionpublic void setFinalize(boolean finalize)
finalize - default `true` - finalizers are enabledpublic void compress(java.nio.ByteBuffer source)
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushablejava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable