Package com.twelvemonkeys.servlet
Class ServletResponseStreamDelegate
- java.lang.Object
-
- com.twelvemonkeys.servlet.ServletResponseStreamDelegate
-
public class ServletResponseStreamDelegate extends java.lang.Object
A delegate for handling stream support in wrapped servlet responses.Client code should delegate
getOutputStream
,getWriter
,flushBuffer
andresetBuffer
methods 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.ServletResponse
response
-
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.OutputStream
createOutputStream()
Returns theOutputStream
.void
flushBuffer()
javax.servlet.ServletOutputStream
getOutputStream()
java.io.PrintWriter
getWriter()
void
resetBuffer()
-
-
-
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.IOException
Returns 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 (unlessresetBuffer
is invoked).This implementation simply returns the output stream from the wrapped response.
- Returns:
- the
OutputStream
to 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()
-
-