• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to write contents in a ByteArrayOutputStream to a disk file?

 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some contents in a ByteArrayOutputStream object. How do I send the contents to a PC file such as abc.txt?
Thanks.
Bruce
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found out:
OutputStream outputStream = new FileOutputStream ("c:/x/a.pdf");
byteArrayOutputStream.writeTo(outputStream);

[This message has been edited by Bruce Jin (edited November 28, 2001).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!