6984545: (fc) transferFrom does not throw NonReadableChannelException when target is size 0 and non-readable
Rémi Forax
forax at univ-mlv.fr
Wed Sep 15 01:58:27 PDT 2010
Le 15/09/2010 05:38, Alan Bateman a écrit :
> Rémi Forax wrote:
>> :
>> what if transferFromArbitraryChannel is used instead of
>> transferFromFileChannel ?
>>
>> Rémi
>> PS: I hope this sentence is correct in English
> Your English is fine and it's a good question. In the arbitrary
> channel (not a FileChannel) case then the transferFrom/transferTo
> methods would need to attempt a read or write for the count == 0 case
> as they can't tell from the channel type. The long standing behavior
> has been to do nothing and so would require a bit of consideration
> before changing it. In implementation terms this would mean reading
> with a buffer that has 0 bytes remaining. I'll create a bug as a
> reminder. It may be that the spec needs to be clarified for this
> corner case. For now, I'd like to restore the behavior for the
> FileChannel case as it is impacted by the zero length file case.
>
> -Alan.
>
Ok,
fix for 6984545 is good.
Rémi
More information about the nio-dev
mailing list