Apache Tomcat 7.0.22

org.apache.coyote.http11.filters
Class FlushableGZIPOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.util.zip.DeflaterOutputStream
              extended by java.util.zip.GZIPOutputStream
                  extended by org.apache.coyote.http11.filters.FlushableGZIPOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class FlushableGZIPOutputStream
extends GZIPOutputStream

Extension of GZIPOutputStream to workaround for a couple of long standing JDK bugs (Bug 4255743 and Bug 4813885) so the GZIP'd output can be flushed.


Field Summary
 
Fields inherited from class java.util.zip.GZIPOutputStream
crc
 
Fields inherited from class java.util.zip.DeflaterOutputStream
buf, def
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
FlushableGZIPOutputStream(OutputStream os)
           
 
Method Summary
protected  void deflate()
           
 void flush()
           
 void write(byte[] bytes)
           
 void write(byte[] bytes, int i, int i1)
          Here we make sure we have received data, so that the header has been for sure written to the output stream already.
 void write(int i)
           
 
Methods inherited from class java.util.zip.GZIPOutputStream
finish
 
Methods inherited from class java.util.zip.DeflaterOutputStream
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlushableGZIPOutputStream

public FlushableGZIPOutputStream(OutputStream os)
                          throws IOException
Throws:
IOException
Method Detail

write

public void write(byte[] bytes,
                  int i,
                  int i1)
           throws IOException
Here we make sure we have received data, so that the header has been for sure written to the output stream already.

Overrides:
write in class GZIPOutputStream
Throws:
IOException

write

public void write(int i)
           throws IOException
Overrides:
write in class DeflaterOutputStream
Throws:
IOException

write

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

flush

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

deflate

protected void deflate()
                throws IOException
Overrides:
deflate in class DeflaterOutputStream
Throws:
IOException

Apache Tomcat 7.0.22

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.