src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template
changeset 53901 0448cb38c418
parent 53855 7c362992527a
child 53959 1542e63eb537
--- 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());