in src/main/java/org/apache/commons/text/StrBuilder.java [121:137]
public int read(final char[] b, final int off, int len) {
if (off < 0 || len < 0 || off > b.length || off + len > b.length || off + len < 0) {
throw new IndexOutOfBoundsException();
}
if (len == 0) {
return 0;
}
if (pos >= size()) {
return -1;
}
if (pos + len > size()) {
len = size() - pos;
}
StrBuilder.this.getChars(pos, pos + len, b, off);
pos += len;
return len;
}