Details
Description
Summary
Add verbiage making explicit the behavior of the Reader
methods read(char[] cbuf) when cbuf.length is zero and read(char[] cbuf, int off, int len) when len is zero.
Problem
The behaviors of read(char[] cbuf) when cbuf.length is zero and read(char[] cbuf, int off, int len) when len is zero are not as completely specified as in the analogous InputStream
methods.
Solution
Add verbiage making explicit the behavior of the Reader
methods read(char[] cbuf) when cbuf.length is zero and read(char[] cbuf, int off, int len) when len is zero.
Specification
To the specification of Reader::read(char[])
add the paragraph
If the length of cbuf is zero, then no characters are read and 0 is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1 is returned; otherwise, at least one character is read and stored into cbuf.
and to that of Reader::read(char[],int,int)
add the paragraph
If len is zero, then no characters are read and 0 is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1 is returned; otherwise, at least one character is read and stored into cbuf.
Attachments
Issue Links
- csr of
-
JDK-8248383 Clarify java.io.Reader.read(char[], ...) behavior for full array
- Closed