Package com.twelvemonkeys.servlet
Class ServletResponseStreamDelegate
- java.lang.Object
-
- com.twelvemonkeys.servlet.ServletResponseStreamDelegate
-
public class ServletResponseStreamDelegate extends java.lang.ObjectA delegate for handling stream support in wrapped servlet responses.Client code should delegate
getOutputStream,getWriter,flushBufferandresetBuffermethods from the servlet response.- Version:
- $Id: ServletResponseStreamDelegate.java#2 $
- Author:
- Harald Kuhr, last modified by $Author: haku $
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.ServletResponseresponse
-
Constructor Summary
Constructors Constructor Description ServletResponseStreamDelegate(javax.servlet.ServletResponse pResponse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.OutputStreamcreateOutputStream()Returns theOutputStream.voidflushBuffer()javax.servlet.ServletOutputStreamgetOutputStream()java.io.PrintWritergetWriter()voidresetBuffer()
-
-
-
Method Detail
-
getOutputStream
public final javax.servlet.ServletOutputStream getOutputStream() throws java.io.IOException- Throws:
java.io.IOException
-
getWriter
public final java.io.PrintWriter getWriter() throws java.io.IOException- Throws:
java.io.IOException
-
createOutputStream
protected java.io.OutputStream createOutputStream() throws java.io.IOExceptionReturns theOutputStream. Subclasses should override this method to provide a decorated output stream. This method is guaranteed to be invoked only once for a request/response (unlessresetBufferis invoked).This implementation simply returns the output stream from the wrapped response.
- Returns:
- the
OutputStreamto use for the response - Throws:
java.io.IOException- if an I/O exception occurs
-
flushBuffer
public void flushBuffer() throws java.io.IOException- Throws:
java.io.IOException
-
resetBuffer
public void resetBuffer()
-
-