@InterfaceAudience.Public @InterfaceStability.Evolving public class CompressorStream extends CompressionOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
buffer |
protected boolean |
closed |
protected Compressor |
compressor |
out| Modifier | Constructor and Description |
|---|---|
protected |
CompressorStream(OutputStream out)
Allow derived classes to directly set the underlying stream.
|
|
CompressorStream(OutputStream out,
Compressor compressor) |
|
CompressorStream(OutputStream out,
Compressor compressor,
int bufferSize) |
| Modifier and Type | Method and 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, getIOStatisticswriteprotected Compressor compressor
protected byte[] buffer
protected boolean closed
public CompressorStream(OutputStream out, Compressor compressor, int bufferSize)
public CompressorStream(OutputStream out, Compressor compressor)
protected CompressorStream(OutputStream out)
out - Underlying output stream.public void write(byte[] b,
int off,
int len)
throws IOException
CompressionOutputStreamwrite in class CompressionOutputStreamIOExceptionprotected void compress()
throws IOException
IOExceptionpublic void finish()
throws IOException
CompressionOutputStreamfinish in class CompressionOutputStreamIOException - raised on errors performing I/O.public void resetState()
throws IOException
CompressionOutputStreamresetState in class CompressionOutputStreamIOException - raised on errors performing I/O.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class CompressionOutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionCopyright © 2023 Apache Software Foundation. All rights reserved.