• Post Reply Bookmark Topic Watch Topic
  • New Topic

ByteArrayOutputStream  RSS feed

 
Patrick Mugabe
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am generating a PDF file and saving it to a Byte array output stream. I have no problems writing to file but I want to pass it back to my web service without saving to file.

How do I convert the ByteArrayOutputStream back to PDF?
[ September 29, 2006: Message edited by: Patrick Mugabe ]
 
Patrick Mugabe
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, don't worry I found a way. I have to get the byte array of the ByteArrayOutputStream e.g.
byte[] bytes = baos.toByteArray(); (where baos is an instance of the ByteArrayOutputStream)

then read it using ByteArrayInputStream
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!