6984545: (fc) transferFrom does not throw NonReadableChannelException when target is size 0 and non-readable

Rémi Forax forax at univ-mlv.fr
Tue Sep 14 16:15:47 PDT 2010


Le 15/09/2010 00:45, Alan Bateman a écrit :
>
> The changes for 6431344 introduced a small regression. If 
> FileChannel's transferFrom is invoked with a source that is 
> non-readable FileChannel then NonReadableChannelException is not 
> thrown when there are no bytes to transfer. The fix is to trivially 
> check if the source is readable:
>    http://cr.openjdk.java.net/~alanb/6984545/webrev/
>
> Thanks,
> Alan.
>
> [1] http://hg.openjdk.java.net/jdk7/jdk7/jdk/rev/f4a2b4e7a831

what if transferFromArbitraryChannel is used instead of 
transferFromFileChannel ?

Rémi
PS: I hope this sentence is correct in English


More information about the nio-dev mailing list