Package com.github.luben.zstd
Class ZstdDirectBufferCompressingStreamNoFinalizer
- java.lang.Object
-
- com.github.luben.zstd.ZstdDirectBufferCompressingStreamNoFinalizer
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class ZstdDirectBufferCompressingStreamNoFinalizer extends java.lang.Object implements java.io.Closeable, java.io.Flushable
-
-
Constructor Summary
Constructors Constructor Description ZstdDirectBufferCompressingStreamNoFinalizer(@NotNull java.nio.ByteBuffer target, int level)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcompress(@NotNull java.nio.ByteBuffer source)voidflush()protected @NotNull java.nio.ByteBufferflushBuffer(@NotNull 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 intrecommendedOutputBufferSize()@NotNull ZstdDirectBufferCompressingStreamNoFinalizersetDict(byte @NotNull [] dict)@NotNull ZstdDirectBufferCompressingStreamNoFinalizersetDict(@NotNull ZstdDictCompress dict)
-
-
-
Method Detail
-
flushBuffer
@NotNull protected @NotNull java.nio.ByteBuffer flushBuffer(@NotNull @NotNull java.nio.ByteBuffer toFlush) throws java.io.IOExceptionThis 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:
java.io.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
public void compress(@NotNull @NotNull java.nio.ByteBuffer source) throws java.io.IOException- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- 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
-
-