protected void replace(int position,int rmSize,Object addItems,int addSize){
  int addOffset=0;
  if (addSize == 0) {
    close(position,rmSize);
    return;
  }
 else   if (rmSize > addSize) {
    close(position + addSize,rmSize - addSize);
  }
 else {
    int endSize=addSize - rmSize;
    int end=open(position + rmSize,endSize);
    System.arraycopy(addItems,rmSize,array,end,endSize);
    addSize=rmSize;
  }
  System.arraycopy(addItems,addOffset,array,position,addSize);
}

protected void replace ( int position , int rmSize , Object addItems , int addSize ) { int addOffset = 0 ; if ( addSize == 0 ) { close ( position , rmSize ) ; return ; } else if ( rmSize > addSize ) { close ( position + addSize , rmSize - addSize ) ; } else { int endSize = addSize - rmSize ; int end = open ( position + rmSize , endSize ) ; System . arraycopy ( addItems , rmSize , array , end , endSize ) ; addSize = rmSize ; } System . arraycopy ( addItems , addOffset , array , position , addSize ) ; }
replace the given logical position in the storage with the given new items . this will move the gap to the area being changed if the gap is not currently located at the change location .
