AsynchronousFileChannel.transferTo?
Remi Forax
forax at univ-mlv.fr
Sat Dec 3 09:25:39 PST 2011
I've written something like this.
An asynchronous copy that returns a Future.
I can provide the code if you want.
Rémi
Alan Bateman <Alan.Bateman at oracle.com> wrote:
>On 02/12/2011 19:45, Benedict Elliott Smith wrote:
>> Hi,
>>
>> I just made the fairly rookie error of assuming that
>> AsynchronousFileChannel would have an analagous method to
>> FileChannel.transferTo, but unfortunately this appears not to be the case.
>>
>> Is this simply due to a lack of time, or is there some reason why it
>> cannot be incorporated? I have lots of disk to network transfers to
>> perform, and I'd rather not spawn a thread for each, but I'd equally
>> rather not copy the data into a buffer and straight back out again;
>> I'd prefer for the transfer to be straight DMA, with a callback
>> letting me know it happened.
>>
>> Are there any plans for this to be supported at any point in the
>> future? Or am I being completely retarded and simply missing the
>> already present functionality? I've searched the obvious places for
>> information but so far no luck, and no discussion of it I could find
>> on the mailing lists.
>>
>> Any light you can shed would be appreciated...
>>
>> Cheers,
>Yes, just lack of time and clearly desirable to be have an asynchronous
>transferTo method. The interesting question is whether the target
>channel (or source in the case of a transferFrom) is a synchronous or
>asynchronous socket channel. For now I'm not aware of anyone working on
>adding this but clearly something desirable to add at some point.
>
>-Alan
>
>
More information about the nio-dev
mailing list