Search code examples
javamodel-view-controllerstruts2struts

What is the need of specifying a stream result's buffer size?


<result name="success" type="stream">
  <param name="contentType">image/jpeg</param>
  <param name="inputName">inputStream</param>
  <param name="contentDisposition">filename="${filename}"</param>
  <param name="bufferSize">1024</param>
</result>

When we download files in Struts 2 why should we specify the buffer size? What is its use?


Solution

  • The size of the buffer affects the processing efficiency of the program. In general, only 1024 should be used.

    Reference: Struts