RFR: 8354724: BufferedReader readAllLines and readString methods [v5]
Brian Burkhalter
bpb at openjdk.org
Fri Apr 18 20:45:47 UTC 2025
On Fri, 18 Apr 2025 19:11:15 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
> Without over-rotating on performance concerns, [...]
Or just for the sake of silliness:
public List<String> readAllLines() throws IOException {
String regex = "(?:\n)|(?:\r)|\r(?=\n)";
return Arrays.asList(readString().split(regex));
}
(My regex knowledge is poor so that might not even be correct.)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24728#issuecomment-2816164684
More information about the core-libs-dev
mailing list