Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reading from inputstreams and writing ....  RSS feed

 
mark stone
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to write -- what we have read from an inputstream ?
eg there are classes like url, urlconnection etc which give you an inputstream. i need to be able to write that information that is being read from the InputStream.
I am able to write to the standard output ok, but i want to write into a file instead.
where inp is InputStream,
while( (ii = inp.read()) != -1 )
{System.out.print( (char)ii );} }
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FileOutputStream or FileWriter!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!