GZIPOutputStream
open class GZIPOutputStream : DeflaterOutputStream
This class implements a stream filter for writing compressed data in the GZIP file format.
Summary
Public constructors
|
|
Creates a new output stream with the specified buffer size.
|
|
Creates a new output stream with the specified buffer size and flush mode.
|
|
Creates a new output stream with a default buffer size.
|
|
Creates a new output stream with a default buffer size and the specified flush mode.
|
Public methods
|
| open Unit |
Finishes writing compressed data to the output stream without closing the underlying stream.
|
| open Unit |
Writes array of bytes to the compressed output stream.
|
Inherited functions
|
From class DeflaterOutputStream
Unit |
close()
Writes remaining compressed data to the output stream and closes the underlying stream.
|
Unit |
deflate()
Writes next block of compressed data to the output stream.
|
Unit |
flush()
Flushes the compressed output stream. If syncFlush is true when this compressed output stream is constructed, this method first flushes the underlying compressor with the flush mode Deflater#SYNC_FLUSH to force all pending data to be flushed out to the output stream and then flushes the output stream. Otherwise this method only flushes the output stream without flushing the compressor.
|
Unit |
write(b: Int)
Writes a byte to the compressed output stream. This method will block until the byte can be written.
|
|
From class FilterOutputStream
Unit |
write(b: ByteArray!)
Writes b.length bytes to this output stream.
The write method of FilterOutputStream calls its write method of three arguments with the arguments b, 0, and b.length.
Note that this method does not call the one-argument write method of its underlying stream with the single argument b.
|
|
Properties
|
| CRC32! |
CRC-32 of uncompressed data.
|
Public constructors
<init>
GZIPOutputStream(
out: OutputStream!,
size: Int)
Creates a new output stream with the specified buffer size.
The new output stream instance is created as if by invoking the 3-argument constructor GZIPOutputStream(out, size, false).
| Parameters |
out |
OutputStream!: the output stream |
size |
Int: the output buffer size |
| Exceptions |
java.io.IOException |
If an I/O error has occurred. |
java.lang.IllegalArgumentException |
if size <= 0 |
<init>
GZIPOutputStream(
out: OutputStream!,
size: Int,
syncFlush: Boolean)
Creates a new output stream with the specified buffer size and flush mode.
| Exceptions |
java.io.IOException |
If an I/O error has occurred. |
java.lang.IllegalArgumentException |
if size <= 0 |
<init>
GZIPOutputStream(out: OutputStream!)
Creates a new output stream with a default buffer size.
The new output stream instance is created as if by invoking the 2-argument constructor GZIPOutputStream(out, false).
| Exceptions |
java.io.IOException |
If an I/O error has occurred. |
<init>
GZIPOutputStream(
out: OutputStream!,
syncFlush: Boolean)
Creates a new output stream with a default buffer size and the specified flush mode.
| Exceptions |
java.io.IOException |
If an I/O error has occurred. |
Public methods
finish
open fun finish(): Unit
Finishes writing compressed data to the output stream without closing the underlying stream. Use this method when applying multiple filters in succession to the same output stream.
| Exceptions |
java.io.IOException |
if an I/O error has occurred |
write
open fun write(
buf: ByteArray!,
off: Int,
len: Int
): Unit
Writes array of bytes to the compressed output stream. This method will block until all the bytes are written.
| Parameters |
b |
the data to be written |
off |
Int: the start offset of the data |
len |
Int: the length of the data |
buf |
ByteArray!: the data to be written |
| Exceptions |
java.io.IOException |
If an I/O error has occurred. |
Properties
crc
protected var crc: CRC32!
CRC-32 of uncompressed data.