--- a/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template Fri Feb 22 09:47:00 2019 -0800
+++ b/src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template Fri Feb 22 10:13:33 2019 -0800
@@ -270,6 +270,25 @@
#end[rw]
}
+#if[char]
+
+ public $Type$Buffer put(String src, int start, int end) {
+ int length = end - start;
+ checkBounds(start, length, src.length());
+ if (isReadOnly())
+ throw new ReadOnlyBufferException();
+ int pos = position();
+ int lim = limit();
+ int rem = (pos <= lim) ? lim - pos : 0;
+ if (length > rem)
+ throw new BufferOverflowException();
+ src.getChars(start, end, hb, ix(pos));
+ position(pos + length);
+ return this;
+ }
+
+#end[char]
+
public $Type$Buffer compact() {
#if[rw]
System.arraycopy(hb, ix(position()), hb, ix(0), remaining());