net.i2p.i2ptunnel
Class GunzipOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.util.zip.InflaterOutputStream
              extended by net.i2p.i2ptunnel.GunzipOutputStream
All Implemented Interfaces:
Closeable, Flushable

 class GunzipOutputStream
extends InflaterOutputStream

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. Modified from net.i2p.util.ResettableGZIPInputStream to use Java 6 InflaterOutputstream

Since:
0.9.21

Field Summary
 
Fields inherited from class java.util.zip.InflaterOutputStream
buf, inf
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
GunzipOutputStream(OutputStream uncompressedStream)
          Build a new Gunzip stream
 
Method Summary
 void close()
           
 boolean getFinished()
          Inflater statistic
 long getRemaining()
          Inflater statistic
 long getTotalExpanded()
          Inflater statistic
 long getTotalRead()
          Inflater statistic
 String toString()
           
 void write(byte[] buf)
           
 void write(byte[] buf, int off, int len)
           
 void write(int b)
           
 
Methods inherited from class java.util.zip.InflaterOutputStream
finish, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GunzipOutputStream

public GunzipOutputStream(OutputStream uncompressedStream)
                   throws IOException
Build a new Gunzip stream

Throws:
IOException
Method Detail

write

public void write(int b)
           throws IOException
Overrides:
write in class InflaterOutputStream
Throws:
IOException

write

public void write(byte[] buf)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] buf,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class InflaterOutputStream
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

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InflaterOutputStream
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object