@@ -2037,19 +2037,6 @@ public abstract sealed class $Type$Buffer
20372037 * Appends the specified character sequence to this
20382038 * buffer <i>(optional operation)</i>.
20392039 *
2040- * <p> An invocation of this method of the form {@code dst.append(csq)}
2041- * behaves in exactly the same way as the invocation
2042- *
2043- * {@snippet lang=java :
2044- * dst.put(csq.toString())
2045- * }
2046- *
2047- * <p> Depending on the specification of {@code toString} for the
2048- * character sequence {@code csq}, the entire sequence may not be
2049- * appended. For instance, invoking the {@link $Type$Buffer#toString()
2050- * toString} method of a character buffer will return a subsequence whose
2051- * content depends upon the buffer's position and limit.
2052- *
20532040 * @param csq
20542041 * The character sequence to append. If {@code csq} is
20552042 * {@code null}, then the four characters {@code "null"} are
@@ -2071,21 +2058,13 @@ public abstract sealed class $Type$Buffer
20712058 else if (csq instanceof CharBuffer cb)
20722059 return put(cb);
20732060 else
2074- return put (csq.toString ());
2061+ return append (csq, 0, csq.length ());
20752062 }
20762063
20772064 /**
20782065 * Appends a subsequence of the specified character sequence to this
20792066 * buffer <i>(optional operation)</i>.
20802067 *
2081- * <p> An invocation of this method of the form {@code dst.append(csq, start,
2082- * end)} when {@code csq} is not {@code null}, behaves in exactly the
2083- * same way as the invocation
2084- *
2085- * {@snippet lang=java :
2086- * dst.put(csq.subSequence(start, end).toString())
2087- * }
2088- *
20892068 * @param csq
20902069 * The character sequence from which a subsequence will be
20912070 * appended. If {@code csq} is {@code null}, then characters
@@ -2127,7 +2106,9 @@ public abstract sealed class $Type$Buffer
21272106 return this;
21282107 }
21292108 CharSequence cs = (csq == null ? "null" : csq);
2130- return put(cs.subSequence(start, end).toString());
2109+ char[] buf = new char[end - start];
2110+ cs.getChars(start, end, buf, 0);
2111+ return put(buf);
21312112 }
21322113
21332114 /**
0 commit comments