> This Pull Request proposes an implementation for > [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new > method `public void getChars(int srcBegin, int srcEnd, char[] dst, int > dstBegin)` to the `CharSequence` interface, providing a **bulk-read** > facility including a default implementation iterating over `charAt(int)`. > > In addition, this Pull Request proposes to replace the implementation of > `Reader.of(CharSequence).read(char[] cbuf, int off, int len)` to invoke > `CharSequence.getChars(next, next + n, cbuf, off)` instead of utilizing > pattern matching for switch. Also, this PR proposes to implement > `CharBuffer.getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)` as > an alias for `CharBuffer.get(srcBegin, dst, dstBegin, srcEnd - srcBegin)`. > > To ensure quality... > * ...the method signature and JavaDocs are adapted from > `AbstractStringBuilder.getChars(...)`. > * ...this PR relies upon the existing tests for `Reader.of(CharSequence)`, as > these provide sufficient coverage of all changes introduced by this PR.
Markus KARG has updated the pull request incrementally with three additional commits since the last revision: - Applied changes requested by Alan: This sentence doesn't make sense, did something get deleted? - Applied changes requested by Alan: Copies chars from this sequence into the given destination array - Replaced JavaDocs of CharBuffer, as suggested by Alan ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21730/files - new: https://git.openjdk.org/jdk/pull/21730/files/d27d1bd8..a5d26c5b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21730&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21730&range=02-03 Stats: 33 lines in 2 files changed: 26 ins; 1 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/21730.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21730/head:pull/21730 PR: https://git.openjdk.org/jdk/pull/21730