public class DeflaterOutputStream extends DeflaterOutputStream implements IFinishable
DeflaterOutputStream that provides
convenient constructors for specifying compression level and buffer size.
The compression level can be set to values between 0 (no compression) and 9 (maximum compression), or use -1 for the default compression level.
buf, defout| Constructor and Description |
|---|
DeflaterOutputStream(OutputStream out)
Creates a new deflater output stream with default compression level and buffer size.
|
DeflaterOutputStream(OutputStream out,
int level)
Creates a new deflater output stream with a specified compression level and default buffer size.
|
DeflaterOutputStream(OutputStream out,
int level,
int size)
Creates a new deflater output stream with a specified compression level and buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this output stream and releases any system resources associated with it.
|
void |
finish()
Finishes writing compressed data to the output stream without closing the underlying stream.
|
deflate, flush, write, writewritepublic DeflaterOutputStream(OutputStream out, int level, int size)
out - the output stream to write compressed data tolevel - the compression level (0-9, or -1 for default)size - the buffer size in bytespublic DeflaterOutputStream(OutputStream out, int level)
out - the output stream to write compressed data tolevel - the compression level (0-9, or -1 for default)public DeflaterOutputStream(OutputStream out)
out - the output stream to write compressed data topublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class DeflaterOutputStreamIOException - if an I/O error occurspublic void finish()
throws IOException
finish in interface IFinishablefinish in class DeflaterOutputStreamIOException - if an I/O error occursCopyright © 1998–2026 Apryse Group NV. All rights reserved.