org.meshcms.core
Class CacheResponseStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjavax.servlet.ServletOutputStream
          extended byorg.meshcms.core.CacheResponseStream

public class CacheResponseStream
extends javax.servlet.ServletOutputStream

Writes the page to both the browser and the cache.

See Also:
CacheResponseWrapper

Constructor Summary
CacheResponseStream(javax.servlet.http.HttpServletResponse response, java.io.OutputStream cacheOutput)
          Creates a new Stream to write to the original output stream of the response and to the passed output stream.
 
Method Summary
 void close()
          Closes both streams.
 void flush()
          Flushes both streams.
 void write(int b)
          Writes to both streams.
 
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, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheResponseStream

public CacheResponseStream(javax.servlet.http.HttpServletResponse response,
                           java.io.OutputStream cacheOutput)
                    throws java.io.IOException
Creates a new Stream to write to the original output stream of the response and to the passed output stream.

Parameters:
response - the original response
cacheOutput - the output for the cache
Throws:
java.io.IOException - if an input or output exception occurred
Method Detail

write

public void write(int b)
           throws java.io.IOException
Writes to both streams.

Parameters:
b - the byte to write
Throws:
java.io.IOException - if an I/O error occurs

flush

public void flush()
           throws java.io.IOException
Flushes both streams.

Throws:
java.io.IOException - if an I/O error occurs

close

public void close()
           throws java.io.IOException
Closes both streams.

Throws:
java.io.IOException - if an I/O error occurs