RFR: 8354724: Methods in java.io.Reader to read all characters and all lines [v22]

Jaikiran Pai jpai at openjdk.org
Fri May 16 08:04:00 UTC 2025


On Wed, 14 May 2025 18:16:22 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Implement the requested methods and add a test thereof.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8354724: Replace getChars in previous commit with subSequence

src/java.base/share/classes/java/io/Reader.java line 478:

> 476:      *
> 477:      * <p> If an I/O error occurs reading from the stream, then it
> 478:      * may do so after some, but not all, characters have been read.

Hello Brian, I read this sentence a couple of times but it wasn't clear to me what this meant. I am guessing that we want to state that if an I/O error occurs when some (but not all?) characters have been read then the stream may be in an inconsistent state? Should we reword this paragraph?

I suspect that sentence was motivated from similar existing text in `Files.readString(...)` and there too I find it confusing.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24728#discussion_r2092538195


More information about the core-libs-dev mailing list