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
CompressorOutputStream
implementation 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
,closeFrameOnFlush
anduseChecksum
.ZstdCompressorOutputStream(java.io.OutputStream outStream, int level)
Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forcloseFrameOnFlush
anduseChecksum
.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 void
close()
void
flush()
java.lang.String
toString()
void
write(byte[] buf, int off, int len)
void
write(int b)
-
-
-
Constructor Detail
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(java.io.OutputStream outStream, int level, boolean closeFrameOnFlush, boolean useChecksum) throws java.io.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:
java.io.IOException
- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(java.io.OutputStream outStream, int level, boolean closeFrameOnFlush) throws java.io.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:
java.io.IOException
- if zstd-jni does- Since:
- 1.18
-
ZstdCompressorOutputStream
public ZstdCompressorOutputStream(java.io.OutputStream outStream, int level) throws java.io.IOException
Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forcloseFrameOnFlush
anduseChecksum
.- 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.IOException
Wraps the given stream into a zstd-jni ZstdOutputStream using the default values forlevel
,closeFrameOnFlush
anduseChecksum
.- 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] buf, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
-