0 Replies Latest reply on Oct 13, 2011 5:54 AM by tigerblue

    Flush during large file streaming?

    tigerblue

      Hi.

      I am trying to send (partly) large data amounts as the result of a web request. All of this data is cached server-side in memory (by Richfaces?) before it is finally sent to the client.

       

      I am using JBoss/Seam together with Richfaces 3.3.1.

       

      My code looks like this (excerpt):

       

      HttpServletResponse response = (HttpServletResponse)facesExternalContext.getResponse();

      ServletOutputStream out = response.getOutputStream();

       

      // Writing large data amounts (problems for >200MB) to out

      // Tried different variants of flush() and flushBuffer() during this writing

       

      out.close();

      facesContext.responseComplete();

       

      The code being used for handling "out" seems to be a org.ajax4jsf.webapp.FilterServletResponseWrapper$ByteArrayServletOutputStream which in turn relies on org.ajax4jsf.io.FastBufferOutputStream to do the actual work.

       

      I have checked this FastBufferOutputStream (and FilterServletResponseWrapper) and they do write all data to in-memory byte arrays.

       

      Question: Is it possible at all to send data to the client before close() and responseComplete() is called? If so can the above classes be configured to do so?