Summary
Clarify the specification of the java.nio.channels.FileChannel.transferFrom
method to make it clear that it returns 0 when the the source channel is at end-of-stream.
Problem
Currently, the API spec for FileChannel.transferFrom is not very clear about the return value, there are several misuse cases where users are not clear about the meaning or value of return value.
Solution
Add a clearer message in the API doc of FileChannel.transferFrom.
Specification
Add the following to the method description:
"No bytes are transferred, and zero is returned, if the source has reached end-of-stream."
- csr of
-
JDK-8260694 (fc) Clarify FileChannel.transferFrom to better describe "no bytes available" case
-
- Resolved
-