public CharBuffer put ( String str , int start , int end ) { int length = str . length ( ) ; if ( start < 0 || end < start || end > length ) { throw new IndexOutOfBoundsException ( ) ; } if ( end - start > remaining ( ) ) { throw new BufferOverflowException ( ) ; } for ( int i = start ; i < end ; i ++ ) { put ( str . charAt ( i ) ) ; } return this ; }
Writes chars of the given string to the current position of this buffer and increases the position by the number of chars written .