Package com.github.luben.zstd
Class ZstdDirectBufferCompressingStream
java.lang.Object
com.github.luben.zstd.ZstdDirectBufferCompressingStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
(package private) ZstdDirectBufferCompressingStreamNoFinalizer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
compress
(ByteBuffer source) protected void
finalize()
void
flush()
protected ByteBuffer
flushBuffer
(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
setDict
(byte[] dict) 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.
-
Field Details
-
inner
-
finalize
private boolean finalize
-
-
Constructor Details
-
ZstdDirectBufferCompressingStream
- Throws:
IOException
-
-
Method Details
-
flushBuffer
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.- Parameters:
toFlush
- buffer that has to be flushed (or most cases, you want to callByteBuffer.flip()
first)- Returns:
- the new buffer to use, for most cases the same as the one passed in, after a call to
ByteBuffer.clear()
. - Throws:
IOException
-
recommendedOutputBufferSize
public static int recommendedOutputBufferSize() -
setDict
- Throws:
IOException
-
setDict
- Throws:
IOException
-
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
-
compress
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
finalize
-