System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize;
System.arraycopy(addItems, 0, buffer, gapStart, addSize); gapStart += addSize; }
  protected void replace(int position, int rmSize, Object addItems,                         int addSize)  {    // Remove content    shiftGap(position);    gapEnd += rmSize;    // If gap is too small, enlarge the gap.    if ((gapEnd - gapStart) < addSize)      shiftEnd(addSize);    // Add new items to the buffer.    if (addItems != null)      {    System.arraycopy(addItems, 0, buffer, gapStart, addSize);    gapStart += addSize;  }  }