Package org.apache.commons.compress.compressors

# Class CompressorOutputStream<T extends OutputStream>

java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.commons.compress.CompressFilterOutputStream<T>
org.apache.commons.compress.compressors.CompressorOutputStream<T>

Type Parameters:
  `T` - The underlying `OutputStream` type.

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

Direct Known Subclasses:
  `BlockLZ4CompressorOutputStream`, `BZip2CompressorOutputStream`, `DeflateCompressorOutputStream`, `FramedLZ4CompressorOutputStream`, `FramedSnappyCompressorOutputStream`, `GzipCompressorOutputStream`, `LZMACompressorOutputStream`, `Pack200CompressorOutputStream`, `SnappyCompressorOutputStream`, `XZCompressorOutputStream`, `ZstdCompressorOutputStream`

public abstract class CompressorOutputStream<T extends OutputStream> extends CompressFilterOutputStream<T>
Abstracts all classes that compress an output stream.

- ## Field Summary

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

  `out`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CompressorOutputStream()`
  Constructs a new instance without a backing `OutputStream`.
  `CompressorOutputStream(T out)`
  Creates an output stream filter built on top of the specified underlying `OutputStream`.

- ## Method Summary

  ### Methods inherited from class org.apache.commons.compress.CompressFilterOutputStream

  `checkOpen, close, finish, isClosed, isFinished, out, write, write, writeUsAscii, writeUsAsciiRaw, writeUtf8`

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

  `flush, write, write, write`

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

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

- ## Constructor Details

  - ### CompressorOutputStream

    public CompressorOutputStream()
    Constructs a new instance without a backing `OutputStream`.

    You must initialize `this.out` after construction.

  - ### CompressorOutputStream

    public CompressorOutputStream(T out)
    Creates an output stream filter built on top of the specified underlying `OutputStream`.
    Parameters:
      `out` - the underlying output stream to be assigned to the field `this.out` for later use, or `null` if this instance is to be created without an underlying stream.
    Since:
      1.27.0