public CharBuffer insert(int index,char[] buffer,int offset,int len){
  int length=length();
  if (index < 0 || length < index)   throw new StringIndexOutOfBoundsException();
  ensureCapacity(len + length);
  int tail=length - index;
  char[] thisBuffer=buffer;
  for (int i=tail - 1; i >= 0; i--)   buffer[index + len + i]=thisBuffer[index + i];
  System.arraycopy(buffer,offset,thisBuffer,index,len);
  length(length + len);
  return this;
}

public CharBuffer insert ( int index , char [ ] buffer , int offset , int len ) { int length = length ( ) ; if ( index < 0 || length < index ) throw new StringIndexOutOfBoundsException ( ) ; ensureCapacity ( len + length ) ; int tail = length - index ; char [ ] thisBuffer = buffer ; for ( int i = tail - 1 ; i >= 0 ; i -- ) buffer [ index + len + i ] = thisBuffer [ index + i ] ; System . arraycopy ( buffer , offset , thisBuffer , index , len ) ; length ( length + len ) ; return this ; }
inserts a character buffer .
