public CharBuffer delete(int start,int end){
  int length=length();
  if (start < 0 || end < start || length < start)   throw new StringIndexOutOfBoundsException();
  end=Math.min(length,end);
  int tail=length - end;
  char[] buffer=buffer();
  for (int i=0; i < tail; i++) {
    buffer[start + i]=buffer[end + i];
  }
  length(length - (end - start));
  return this;
}

public CharBuffer delete ( int start , int end ) { int length = length ( ) ; if ( start < 0 || end < start || length < start ) throw new StringIndexOutOfBoundsException ( ) ; end = Math . min ( length , end ) ; int tail = length - end ; char [ ] buffer = buffer ( ) ; for ( int i = 0 ; i < tail ; i ++ ) { buffer [ start + i ] = buffer [ end + i ] ; } length ( length - ( end - start ) ) ; return this ; }
deletes characters from the buffer .
