This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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).]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!