Class GzipCompressorOutputStream
java.lang.Object
java.io.OutputStream
org.apache.commons.compress.compressors.CompressorOutputStream
org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Compressed output stream using the gzip format. This implementation improves
over the standard
GZIPOutputStream
class by allowing
the configuration of the compression level and the header metadata (file name,
comment, modification time, operating system and extra flags).- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a gzip compressed output stream with the default parameters.GzipCompressorOutputStream
(OutputStream out, GzipParameters parameters) Creates a gzip compressed output stream with the specified parameters. -
Method Summary
-
Constructor Details
-
GzipCompressorOutputStream
Creates a gzip compressed output stream with the default parameters.- Parameters:
out
- the stream to compress to- Throws:
IOException
- if writing fails
-
GzipCompressorOutputStream
Creates a gzip compressed output stream with the specified parameters.- Parameters:
out
- the stream to compress toparameters
- the parameters to use- Throws:
IOException
- if writing fails- Since:
- 1.7
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
finish
Finishes writing compressed data to the underlying stream without closing it.- Throws:
IOException
- on error- Since:
- 1.7
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
- Since:
- 1.7
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
- Since:
- 1.1
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
- Since:
- 1.1
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-