Class ZstdDirectBufferCompressingStreamNoFinalizer
java.lang.Object
com.github.luben.zstd.ZstdDirectBufferCompressingStreamNoFinalizer
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionZstdDirectBufferCompressingStreamNoFinalizer(@NotNull ByteBuffer target, int level) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcompress(@NotNull ByteBuffer source) voidflush()protected @NotNull ByteBufferflushBuffer(@NotNull 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 intsetDict(byte @NotNull [] dict) setDict(@NotNull ZstdDictCompress dict)
-
Constructor Details
-
ZstdDirectBufferCompressingStreamNoFinalizer
public ZstdDirectBufferCompressingStreamNoFinalizer(@NotNull @NotNull ByteBuffer target, int level) throws IOException - Throws:
IOException
-
-
Method Details
-
flushBuffer
@NotNull protected @NotNull ByteBuffer flushBuffer(@NotNull @NotNull ByteBuffer toFlush) throws IOException 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
@NotNull public @NotNull ZstdDirectBufferCompressingStreamNoFinalizer setDict(byte @NotNull [] dict) -
setDict
@NotNull public @NotNull ZstdDirectBufferCompressingStreamNoFinalizer setDict(@NotNull @NotNull ZstdDictCompress dict) -
compress
- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-