net.i2p.util
Class ReusableGZIPOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.util.zip.DeflaterOutputStream
net.i2p.util.ResettableGZIPOutputStream
net.i2p.util.ReusableGZIPOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public class ReusableGZIPOutputStream
- extends ResettableGZIPOutputStream
Provide a cache of reusable GZIP streams, each handling up to 32KB without
expansion.
Fields inherited from class java.util.zip.DeflaterOutputStream |
buf, def |
Fields inherited from class java.io.FilterOutputStream |
out |
Methods inherited from class java.util.zip.DeflaterOutputStream |
deflate |
Methods inherited from class java.io.FilterOutputStream |
flush |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
acquire
public static ReusableGZIPOutputStream acquire()
- Pull a cached instance
release
public static void release(ReusableGZIPOutputStream out)
- Release an instance back into the cache (this will discard any
state)
reset
public void reset()
- clear the data so we can start again afresh
- Overrides:
reset
in class ResettableGZIPOutputStream
setLevel
public void setLevel(int level)
getData
public byte[] getData()
- pull the contents of the stream written
main
public static void main(java.lang.String[] args)