Class 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 and resetBuffer 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  
    • Field Detail

      • response

        protected final javax.servlet.ServletResponse response
    • Constructor Detail

      • ServletResponseStreamDelegate

        public ServletResponseStreamDelegate​(javax.servlet.ServletResponse pResponse)
    • 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 the OutputStream. Subclasses should override this method to provide a decorated output stream. This method is guaranteed to be invoked only once for a request/response (unless resetBuffer 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()