Class ZstdCompressorOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.commons.compress.compressors.CompressorOutputStream
-
- org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,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(OutputStream outStream)Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forlevel,closeFrameOnFlushanduseChecksum.ZstdCompressorOutputStream(OutputStream outStream, int level)Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forcloseFrameOnFlushanduseChecksum.ZstdCompressorOutputStream(OutputStream outStream, int level, boolean closeFrameOnFlush)Wraps the given stream into a zstd-jni ZstdOutputStream using the default value foruseChecksum.ZstdCompressorOutputStream(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()StringtoString()voidwrite(byte[] buf, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Constructor Detail
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(OutputStream outStream, int level, boolean closeFrameOnFlush, boolean useChecksum) throws IOException
Wraps 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:
IOException- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(OutputStream outStream, int level, boolean closeFrameOnFlush) throws IOException
Wraps 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:
IOException- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(OutputStream outStream, int level) throws IOException
Wraps 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:
IOException- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(OutputStream outStream) throws IOException
Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forlevel,closeFrameOnFlushanduseChecksum.- Parameters:
outStream- the stream to write to- Throws:
IOException- if zstd-jni does
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] buf, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
-