org.jets3t.service.io
Class GZipInflatingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.jets3t.service.io.GZipInflatingOutputStream
All Implemented Interfaces:
Closeable, Flushable, OutputStreamWrapper

public class GZipInflatingOutputStream
extends OutputStream
implements OutputStreamWrapper

Output stream that wraps another stream and inflates (de-compresses) the underlying stream's data on-the-fly. This class provides only a basic implementation of GZip functionality.

Author:
James Murty

Field Summary
static int GZIP_MAGIC
           
 
Constructor Summary
GZipInflatingOutputStream(OutputStream outputStream)
           
 
Method Summary
 void close()
           
 void flush()
           
 OutputStream getWrappedOutputStream()
           
 void write(byte[] b, int off, int len)
           
 void write(int value)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GZIP_MAGIC

public static final int GZIP_MAGIC
See Also:
Constant Field Values
Constructor Detail

GZipInflatingOutputStream

public GZipInflatingOutputStream(OutputStream outputStream)
                          throws IOException
Throws:
IOException
Method Detail

write

public void write(int value)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

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

getWrappedOutputStream

public OutputStream getWrappedOutputStream()
Specified by:
getWrappedOutputStream in interface OutputStreamWrapper
Returns:
the underlying input stream wrapped by this class.