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 );} }