ByteArrayOutputStream to PrintWriter (Java Servlet)

Posted by Thomas on Stack Overflow See other posts from Stack Overflow or by Thomas
Published on 2010-04-26T11:41:51Z Indexed on 2010/04/26 13:53 UTC
Read the original article Hit count: 151

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!

© Stack Overflow or respective owner

Related posts about java

Related posts about servlets