org.talika.tarsis.filters.gzip
Class GZIPServletOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjavax.servlet.ServletOutputStream
          extended byorg.talika.tarsis.filters.gzip.GZIPServletOutputStream

public final class GZIPServletOutputStream
extends javax.servlet.ServletOutputStream

ServletOutputStream wrapper that allows us to compress response.

Version:
$Revision: 122 $
Author:
Jose M. Palomar

Constructor Summary
GZIPServletOutputStream(javax.servlet.ServletOutputStream out)
          Creates an output stream adaptor wrapping the given output stream.
GZIPServletOutputStream(javax.servlet.ServletOutputStream out, int size)
          Creates an output stream adaptor wrapping the given output stream and buffer size.
 
Method Summary
 void close()
          Closes this output stream and releases any system resources associated with this stream.
 void flush()
          Flushes this output stream and forces any buffered output bytes to be written out.
 void write(byte[] data, int off, int len)
          Writes len bytes from the specified byte array starting at offset off to this output stream.
 void write(int data)
          Writes the specified byte to this output stream.
 
Methods inherited from class javax.servlet.ServletOutputStream
print, print, print, print, print, print, print, println, println, println, println, println, println, println, println
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GZIPServletOutputStream

public GZIPServletOutputStream(javax.servlet.ServletOutputStream out)
                        throws java.io.IOException
Creates an output stream adaptor wrapping the given output stream.

Parameters:
out - ServletOutputStream output stream to be wrapped.
Throws:
java.io.IOException - if an input or output exception occurs.

GZIPServletOutputStream

public GZIPServletOutputStream(javax.servlet.ServletOutputStream out,
                               int size)
                        throws java.io.IOException
Creates an output stream adaptor wrapping the given output stream and buffer size.

Parameters:
out - ServletOutputStream output stream to be wrapped.
size - int buffer size.
Throws:
java.io.IOException - if an input or output exception occurs.
Method Detail

write

public void write(byte[] data,
                  int off,
                  int len)
           throws java.io.IOException
Writes len bytes from the specified byte array starting at offset off to this output stream.

Parameters:
data - byte[] the data.
off - int the start offset in the data.
len - int the number of bytes to write.
Throws:
java.io.IOException - if an input or output exception occurs.

write

public void write(int data)
           throws java.io.IOException
Writes the specified byte to this output stream.

Parameters:
data - int the byte.
Throws:
java.io.IOException - if an input or output exception occurs.

close

public void close()
           throws java.io.IOException
Closes this output stream and releases any system resources associated with this stream.

Throws:
java.io.IOException - if an input or output exception occurs.

flush

public void flush()
           throws java.io.IOException
Flushes this output stream and forces any buffered output bytes to be written out.

Throws:
java.io.IOException - if an input or output exception occurs.


Copyright © 2002-2005 Talika Open Source Group. All Rights Reserved.