java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable, IOStatisticsSourceBlockCompressorStream@Public @Evolving public class CompressorStream extends CompressionOutputStream
| Modifier and Type | Field | Description |
|---|---|---|
protected byte[] |
buffer |
|
protected boolean |
closed |
|
protected Compressor |
compressor |
out| Modifier | Constructor | Description |
|---|---|---|
protected |
CompressorStream(java.io.OutputStream out) |
Allow derived classes to directly set the underlying stream.
|
|
CompressorStream(java.io.OutputStream out,
Compressor compressor) |
|
|
CompressorStream(java.io.OutputStream out,
Compressor compressor,
int bufferSize) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
protected void |
compress() |
|
void |
finish() |
Finishes writing compressed data to the output stream
without closing the underlying stream.
|
void |
resetState() |
Reset the compression to the initial state.
|
void |
write(byte[] b,
int off,
int len) |
Write compressed bytes to the stream.
|
void |
write(int b) |
flush, getIOStatisticsprotected Compressor compressor
protected byte[] buffer
protected boolean closed
public CompressorStream(java.io.OutputStream out,
Compressor compressor,
int bufferSize)
public CompressorStream(java.io.OutputStream out,
Compressor compressor)
protected CompressorStream(java.io.OutputStream out)
out - Underlying output stream.public void write(byte[] b,
int off,
int len)
throws java.io.IOException
CompressionOutputStreamwrite in class CompressionOutputStreamjava.io.IOExceptionprotected void compress()
throws java.io.IOException
java.io.IOExceptionpublic void finish()
throws java.io.IOException
CompressionOutputStreamfinish in class CompressionOutputStreamjava.io.IOException - raised on errors performing I/O.public void resetState()
throws java.io.IOException
CompressionOutputStreamresetState in class CompressionOutputStreamjava.io.IOException - raised on errors performing I/O.public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class CompressionOutputStreamjava.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.