Package net.sf.jazzlib
Class GZIPOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
net.sf.jazzlib.DeflaterOutputStream
net.sf.jazzlib.GZIPOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
This filter stream is used to compress a stream into a "GZIP" stream. The
"GZIP" format is described in RFC 1952.
- Since:
- JDK 1.1
-
Field Summary
FieldsFields inherited from class net.sf.jazzlib.DeflaterOutputStream
buf, defFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionGZIPOutputStream(OutputStream out, int size) Creates a GZIPOutputStream with the specified buffer size -
Method Summary
Methods inherited from class net.sf.jazzlib.DeflaterOutputStream
deflate, flush, writeMethods inherited from class java.io.FilterOutputStream
writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
crc
CRC-32 value for uncompressed data
-
-
Constructor Details
-
GZIPOutputStream
- Throws:
IOException
-
GZIPOutputStream
Creates a GZIPOutputStream with the specified buffer size- Parameters:
out- The stream to read compressed data fromsize- Size of the buffer to use- Throws:
IOException
-
-
Method Details
-
write
Description copied from class:DeflaterOutputStreamWrites a len bytes from an array to the compressed stream.- Overrides:
writein classDeflaterOutputStream- Parameters:
buf- the byte array.off- the offset into the byte array where to start.len- the number of bytes to write.- Throws:
IOException
-
close
Writes remaining compressed output data to the output stream and closes it.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classDeflaterOutputStream- Throws:
IOException
-
finish
Description copied from class:DeflaterOutputStreamFinishes the stream by calling finish() on the deflater. This was the only way to ensure that all bytes are flushed in Sun's JDK.- Overrides:
finishin classDeflaterOutputStream- Throws:
IOException
-