I don't agree with all that Keith wrote here -- buffering both input and output, then providing additional buffers and copying over and over again, but take a look at the code for copying from one file to another, from the
Java Almanac::
(I think you could do better by closing the streams in a finally block.) Given that url.openStream() returns an InputStream, all that needs to be added is q.e.d.