Package org.apache.commons.compress.compressors.zstandard

# Class ZstdCompressorOutputStream

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.commons.compress.compressors.CompressorOutputStream<com.github.luben.zstd.ZstdOutputStream>
org.apache.commons.compress.compressors.zstandard.ZstdCompressorOutputStream

All Implemented Interfaces:
  `Closeable`, `Flushable`, `AutoCloseable`

public class ZstdCompressorOutputStream extends CompressorOutputStream<com.github.luben.zstd.ZstdOutputStream>
`CompressorOutputStream` implementation to create Zstandard encoded stream. Library relies on Zstandard JNI

Since:
  1.16

- ## Field Summary

  ### Fields inherited from class java.io.FilterOutputStream

  `out`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ZstdCompressorOutputStream(OutputStream outStream)`
  Wraps the given stream into a zstd-jni ZstdOutputStream using the default values for `level`, `closeFrameOnFlush` and `useChecksum`.
  `ZstdCompressorOutputStream(OutputStream outStream, int level)`
  Wraps the given stream into a zstd-jni ZstdOutputStream using the default values for `closeFrameOnFlush` and `useChecksum`.
  `ZstdCompressorOutputStream(OutputStream outStream, int level, boolean closeFrameOnFlush)`
  Wraps the given stream into a zstd-jni ZstdOutputStream using the default value for `useChecksum`.
  `ZstdCompressorOutputStream(OutputStream outStream, int level, boolean closeFrameOnFlush, boolean useChecksum)`
  Wraps the given stream into a zstd-jni ZstdOutputStream.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `toString()`
  `void`
  `write(byte[] buf, int off, int len)`

  ### Methods inherited from class org.apache.commons.compress.compressors.CompressorOutputStream

  `out`

  ### Methods inherited from class java.io.FilterOutputStream

  `close, flush, write, write`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ZstdCompressorOutputStream

    public ZstdCompressorOutputStream(OutputStream outStream) throws IOException
    Wraps the given stream into a zstd-jni ZstdOutputStream using the default values for `level`, `closeFrameOnFlush` and `useChecksum`.
    Parameters:
      `outStream` - the stream to write to
    Throws:
      `IOException` - if zstd-jni does

  - ### ZstdCompressorOutputStream

    public ZstdCompressorOutputStream(OutputStream outStream, int level) throws IOException
    Wraps the given stream into a zstd-jni ZstdOutputStream using the default values for `closeFrameOnFlush` and `useChecksum`.
    Parameters:
      `outStream` - the stream to write to
      `level` - value for zstd-jni's level 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 for `useChecksum`.
    Parameters:
      `outStream` - the stream to write to
      `level` - value for zstd-jni's level argument
      `closeFrameOnFlush` - value for zstd-jni's closeFrameOnFlush argument
    Throws:
      `IOException` - if zstd-jni does
    Since:
      1.18

  - ### 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 to
      `level` - value for zstd-jni's level argument
      `closeFrameOnFlush` - value for zstd-jni's closeFrameOnFlush argument
      `useChecksum` - value for zstd-jni's useChecksum argument
    Throws:
      `IOException` - if zstd-jni does
    Since:
      1.18

- ## Method Details

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### write

    public void write(byte[] buf, int off, int len) throws IOException
    Overrides:
      `write` in class `FilterOutputStream`
    Throws:
      `IOException`