int index = Collections.binarySearch(positions, new GapContentPosition( gapEnd)); if (index < 0) { index = -(index + 1); } for (ListIterator i = positions.listIterator(index); i.hasNext();) { GapContentPosition p = (GapContentPosition) i.next(); p.mark += delta; }
  protected void shiftEnd(int newSize)  {    char[] newBuf = (char[]) allocateArray(length() + newSize);    System.arraycopy(buffer, 0, newBuf, 0, gapStart);    System.arraycopy(buffer, gapEnd, newBuf, gapStart + newSize,                     buffer.length - gapEnd);    gapEnd = gapStart + newSize;    buffer = newBuf;  }