FTP with Inputstream?

If I want to transfer a file between machines, I can use the URL class to get the data into an inputstream, it looks like, but can I then pass that into a file to write it out? I don’t see where, and search isn’t coming up.

I was looking for something like a File constructor with an inputstream (plus path etc.) as a parameter?

Or should I look elsewhere? I can also use my own sockets to transfer the data, but then I still need to get the incoming data - again a stream probably, into a file.

Any clues please?


do something like:

File(T(“foo.dat”)).createOutputStream().writeFromInputStream(is, -1);

Ah-ha! Thought there must be something. Thanks.