public class DeflateCompressorOutputStream extends CompressorOutputStream
Constructor and Description |
---|
DeflateCompressorOutputStream(OutputStream outputStream)
Creates a Deflate compressed output stream with the default parameters.
|
DeflateCompressorOutputStream(OutputStream outputStream,
DeflateParameters parameters)
Creates a Deflate compressed output stream with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finish()
Finishes compression without closing the underlying stream.
|
void |
flush()
Flushes the encoder and calls
outputStream.flush() . |
void |
write(byte[] buf,
int off,
int len) |
void |
write(int b) |
write
public DeflateCompressorOutputStream(OutputStream outputStream)
outputStream
- the stream to wrappublic DeflateCompressorOutputStream(OutputStream outputStream, DeflateParameters parameters)
outputStream
- the stream to wrapparameters
- the deflate parameters to applypublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void finish() throws IOException
No more data can be written to this stream after finishing.
IOException
- on errorpublic void flush() throws IOException
outputStream.flush()
.
All buffered pending data will then be decompressible from
the output stream. Calling this function very often may increase
the compressed file size a lot.flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(byte[] buf, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.