@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class CompressionOutputStream extends OutputStream implements org.apache.hadoop.fs.statistics.IOStatisticsSource
| Modifier and Type | Field and Description | 
|---|---|
| protected OutputStream | outThe output stream to be compressed. | 
| Modifier | Constructor and Description | 
|---|---|
| protected  | CompressionOutputStream(OutputStream out)Create a compression output stream that writes
 the compressed bytes to the given stream. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close() | 
| abstract void | finish()Finishes writing compressed data to the output stream 
 without closing the underlying stream. | 
| void | flush() | 
| IOStatistics | getIOStatistics()Return any IOStatistics provided by the underlying stream. | 
| abstract void | resetState()Reset the compression to the initial state. | 
| abstract void | write(byte[] b,
     int off,
     int len)Write compressed bytes to the stream. | 
write, writeprotected final OutputStream out
protected CompressionOutputStream(OutputStream out)
out - out.public void close()
           throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
           throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic abstract void write(byte[] b,
                           int off,
                           int len)
                    throws IOException
write in class OutputStreamIOExceptionpublic abstract void finish()
                     throws IOException
IOException - raised on errors performing I/O.public abstract void resetState()
                         throws IOException
IOException - raised on errors performing I/O.public IOStatistics getIOStatistics()
getIOStatistics in interface org.apache.hadoop.fs.statistics.IOStatisticsSourceCopyright © 2025 Apache Software Foundation. All rights reserved.