title: ByteArrayOutputStream to PrintWriter (Java Servlet)
body: <p>Writing generated PDF (ByteArrayOutputStream) in a Servlet to PrintWriter.</p>
  
  <p>I am desperately looking for a way to write a generated PDF file to the response PrintWriter. 
  Since a Filter up the hierarchy chain has already called response.getWriter() I can't get response.getOutputStream().</p>
  
  <p>I do have a ByteArrayOutputStream where I generated the PDF into. Now all I need is a way to output the content of this ByteArrayOutputStream to the PrintWriter. If anyone could give me a helping hand would be very much appreciated!</p>