FTP with Inputstream?


#1

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?

Bruce


#2

do something like:

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


#3

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


#4