RFR: 8354724: BufferedReader readAllLines and readString methods [v5]

Brian Burkhalter bpb at openjdk.org
Fri Apr 18 18:21:52 UTC 2025


On Fri, 18 Apr 2025 17:35:00 GMT, Stuart Marks <smarks at openjdk.org> wrote:

> There's logic in readLine() that terminates the current line if a CR is encountered, and it _also_ sets a `skipLF` flag which skips the LF if it's the very next character.

I will also point out here that, based on a somewhat cursory search, it looks like every implementation of `readLine` has a "push back" capability. For example, `BufferedReader` has the character buffer `cb`, and both `RandomAccessFile` and `ImageInputStream[Impl]` use `seek` to backtrack.

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

PR Comment: https://git.openjdk.org/jdk/pull/24728#issuecomment-2815968847


More information about the core-libs-dev mailing list