On Sun, 6 Oct 2024 19:24:07 GMT, Brett Okken <d...@openjdk.org> wrote:
>> Markus KARG has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixup! Reader.of(String) >> >> Dropping non-public JavaDocs > > src/java.base/share/classes/java/io/Reader.java line 203: > >> 201: int n = Math.min(length - next, len); >> 202: switch (cs) { >> 203: case String s -> s.getChars(next, next + n, cbuf, >> off); > > There was some discussion on the mailing list of introducing a method to > CharSequence for bulk getChars. Doing that would help both here and in > Appendable/Writer implementations like StringWriter, PrintWriter, and > OutputStreamWriter which currently convert to a String to then write. > > https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/io/Writer.java#L367 > > https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/io/OutputStreamWriter.java#L253 I believe this batch operation would be a useful addition, but it is best reserved for another RFE. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21371#discussion_r1789479245