ByteArrayOutputStream to PrintWriter (Java Servlet)
- by Thomas
Writing generated PDF (ByteArrayOutputStream) in a Servlet to PrintWriter.
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().
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!