private void replaceImpl(final int startIndex,final int endIndex,final int removeLen,final String insertStr,final int insertLen){
  final int newSize=size - removeLen + insertLen;
  if (insertLen != removeLen) {
    ensureCapacity(newSize);
    System.arraycopy(buffer,endIndex,buffer,startIndex + insertLen,size - endIndex);
    size=newSize;
  }
  if (insertLen > 0) {
    insertStr.getChars(0,insertLen,buffer,startIndex);
  }
}

private void replaceImpl ( final int startIndex , final int endIndex , final int removeLen , final String insertStr , final int insertLen ) { final int newSize = size - removeLen + insertLen ; if ( insertLen != removeLen ) { ensureCapacity ( newSize ) ; System . arraycopy ( buffer , endIndex , buffer , startIndex + insertLen , size - endIndex ) ; size = newSize ; } if ( insertLen > 0 ) { insertStr . getChars ( 0 , insertLen , buffer , startIndex ) ; } }
internal method to delete a range without validation .
