Package net.i2p.i2ptunnel.util
Class GunzipOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.util.zip.InflaterOutputStream
net.i2p.i2ptunnel.util.GunzipOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Gunzip implementation per
RFC 1952, reusing
java's standard CRC32 and Inflater and InflaterOutputStream implementations.
Note that the underlying InflaterOutputStream cannot be reused after close(),
so we don't have a Reusable version of this.
Sets up GunzipOutputStream -- InflaterOutputStream -- CRC32OutputStream -- uncompressedStream
Not a public API, subject to change, not for external use.
Modified from net.i2p.util.ResettableGZIPInputStream to use Java 6 InflaterOutputstream
- Since:
- 0.9.21, public since 0.9.50 for LocalHTTPServer, moved to util in 0.9.62
-
Field Summary
Fields inherited from class java.util.zip.InflaterOutputStream
buf, infFields inherited from class java.io.FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionGunzipOutputStream(OutputStream uncompressedStream) Build a new Gunzip streamGunzipOutputStream(OutputStream uncompressedStream, LimitOutputStream.DoneCallback cb) With a callback when done -
Method Summary
Methods inherited from class java.util.zip.InflaterOutputStream
finish, flushMethods inherited from class java.io.FilterOutputStream
writeMethods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
GunzipOutputStream
Build a new Gunzip stream- Throws:
IOException
-
GunzipOutputStream
public GunzipOutputStream(OutputStream uncompressedStream, LimitOutputStream.DoneCallback cb) throws IOException With a callback when done- Parameters:
cb- may be null- Throws:
IOException- Since:
- 0.9.62
-
-
Method Details
-
write
- Overrides:
writein classInflaterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classInflaterOutputStream- Throws:
IOException
-
getTotalRead
public long getTotalRead()Inflater statistic -
getTotalExpanded
public long getTotalExpanded()Inflater statistic -
getRemaining
public long getRemaining()Inflater statistic -
getFinished
public boolean getFinished()Inflater statistic -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInflaterOutputStream- Throws:
IOException
-
toString
-