public static void insertObjectAtOffset(Object[] sourceArray,Object[] destinationArray,int offset,Object o){
  if (offset == 0) {
    destinationArray[0]=o;
    System.arraycopy(sourceArray,0,destinationArray,1,sourceArray.length);
  }
 else {
    if (offset == sourceArray.length) {
      System.arraycopy(sourceArray,0,destinationArray,0,sourceArray.length);
      destinationArray[sourceArray.length]=o;
    }
 else {
      System.arraycopy(sourceArray,0,destinationArray,0,offset);
      destinationArray[offset]=o;
      System.arraycopy(sourceArray,offset,destinationArray,offset + 1,sourceArray.length - offset);
    }
  }
}

public static void insertObjectAtOffset ( Object [ ] sourceArray , Object [ ] destinationArray , int offset , Object o ) { if ( offset == 0 ) { destinationArray [ 0 ] = o ; System . arraycopy ( sourceArray , 0 , destinationArray , 1 , sourceArray . length ) ; } else { if ( offset == sourceArray . length ) { System . arraycopy ( sourceArray , 0 , destinationArray , 0 , sourceArray . length ) ; destinationArray [ sourceArray . length ] = o ; } else { System . arraycopy ( sourceArray , 0 , destinationArray , 0 , offset ) ; destinationArray [ offset ] = o ; System . arraycopy ( sourceArray , offset , destinationArray , offset + 1 , sourceArray . length - offset ) ; } } }
inserts the object at the destination array offset
