Package com.oss.util
Class CompressOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.util.zip.DeflaterOutputStream
com.oss.util.CompressOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionCompressOutputStream
(OutputStream out, Deflater deflater) Constructs CompressOutputStream with the specified compressor and a default buffer size.CompressOutputStream
(OutputStream out, Deflater deflater, int size) -
Method Summary
Methods inherited from class java.util.zip.DeflaterOutputStream
close, flush, write
Methods inherited from class java.io.FilterOutputStream
write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
CompressOutputStream
-
CompressOutputStream
Constructs CompressOutputStream with the specified compressor and a default buffer size.- Parameters:
out
- the output streamdeflater
- the compressor ("deflater")
-
CompressOutputStream
-
-
Method Details
-
write
Writes an array of bytes to the compressed output stream. This method will block until all the bytes are written.- Overrides:
write
in classDeflaterOutputStream
- Parameters:
b
- the data to be writtenoff
- the start offset of the datalen
- the length of the data- Throws:
IOException
- if an I/O error has occurred
-
finish
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.- Overrides:
finish
in classDeflaterOutputStream
- Throws:
IOException
- if an I/O error has occurred
-