Class ZstdCompressorOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.commons.compress.compressors.CompressorOutputStream
-
- org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class ZstdCompressorOutputStream extends CompressorOutputStream
CompressorOutputStreamimplementation to create Zstandard encoded stream. Library relies on Zstandard JNI- Since:
- 1.16
-
-
Constructor Summary
Constructors Constructor Description ZstdCompressorOutputStream(java.io.OutputStream outStream)Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forlevel,closeFrameOnFlushanduseChecksum.ZstdCompressorOutputStream(java.io.OutputStream outStream, int level)Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forcloseFrameOnFlushanduseChecksum.ZstdCompressorOutputStream(java.io.OutputStream outStream, int level, boolean closeFrameOnFlush)Wraps the given stream into a zstd-jni ZstdOutputStream using the default value foruseChecksum.ZstdCompressorOutputStream(java.io.OutputStream outStream, int level, boolean closeFrameOnFlush, boolean useChecksum)Wraps the given stream into a zstd-jni ZstdOutputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()java.lang.StringtoString()voidwrite(byte[] buf, int off, int len)voidwrite(int b)
-
-
-
Constructor Detail
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(java.io.OutputStream outStream, int level, boolean closeFrameOnFlush, boolean useChecksum) throws java.io.IOExceptionWraps the given stream into a zstd-jni ZstdOutputStream.- Parameters:
outStream- the stream to write tolevel- value for zstd-jni's level argumentcloseFrameOnFlush- value for zstd-jni's closeFrameOnFlush argumentuseChecksum- value for zstd-jni's useChecksum argument- Throws:
java.io.IOException- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(java.io.OutputStream outStream, int level, boolean closeFrameOnFlush) throws java.io.IOExceptionWraps the given stream into a zstd-jni ZstdOutputStream using the default value foruseChecksum.- Parameters:
outStream- the stream to write tolevel- value for zstd-jni's level argumentcloseFrameOnFlush- value for zstd-jni's closeFrameOnFlush argument- Throws:
java.io.IOException- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(java.io.OutputStream outStream, int level) throws java.io.IOExceptionWraps the given stream into a zstd-jni ZstdOutputStream using the default values forcloseFrameOnFlushanduseChecksum.- Parameters:
outStream- the stream to write tolevel- value for zstd-jni's level argument- Throws:
java.io.IOException- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(java.io.OutputStream outStream) throws java.io.IOExceptionWraps the given stream into a zstd-jni ZstdOutputStream using the default values forlevel,closeFrameOnFlushanduseChecksum.- Parameters:
outStream- the stream to write to- Throws:
java.io.IOException- if zstd-jni does
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] buf, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
-