Package net.i2p.util
Class ResettableGZIPOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.util.zip.DeflaterOutputStream
net.i2p.util.ResettableGZIPOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Direct Known Subclasses:
ReusableGZIPOutputStream
public class ResettableGZIPOutputStream extends DeflaterOutputStream
GZIP implementation per
RFC 1952, reusing
java's standard CRC32 and Deflater implementations. The main difference
is that this implementation allows its state to be reset to initial
values, and hence reused, while the standard GZIPOutputStream writes the
GZIP header to the stream on instantiation, rather than on first write.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ResettableGZIPOutputStream(OutputStream o)
-
Method Summary
-
Constructor Details
-
Method Details
-
reset
public void reset()Reinitialze everything so we can write a brand new gzip output stream again. -
destroy
Calls super.close(). May not be reused after this.- Throws:
IOException
- Since:
- 0.9.40
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classDeflaterOutputStream
- Throws:
IOException
-
finish
- Overrides:
finish
in classDeflaterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classDeflaterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classDeflaterOutputStream
- Throws:
IOException
-