title: Java: ServletOuputStream content length
body: <p>For downloading a file, i use the following methods of HttpServletResponse</p>
  
  <pre><code>resp.setContentType("application/force-download");
  resp.setHeader("Content-Disposition:", "attachment;filename=" + "\"" + name + "\"");
  </code></pre>
  
  <p>There is also a method to set the content length of the response. What are the advantages of this method? When should I use this method?</p>