public IntArray resize(IntArray array,long size){
  if (array instanceof BigIntArray) {
    return resizeInPlace((BigIntArray)array,size);
  }
 else {
    AbstractArray arr=(AbstractArray)array;
    final IntArray newArray=newIntArray(size,arr.clearOnResize);
    for (long i=0, end=Math.min(size,array.size()); i < end; ++i) {
      newArray.set(i,array.get(i));
    }
    array.close();
    return newArray;
  }
}

public IntArray resize ( IntArray array , long size ) { if ( array instanceof BigIntArray ) { return resizeInPlace ( ( BigIntArray ) array , size ) ; } else { AbstractArray arr = ( AbstractArray ) array ; final IntArray newArray = newIntArray ( size , arr . clearOnResize ) ; for ( long i = 0 , end = Math . min ( size , array . size ( ) ) ; i < end ; ++ i ) { newArray . set ( i , array . get ( i ) ) ; } array . close ( ) ; return newArray ; } }
resize the array to the exact provided size .
