public static final float[] trim(float[] a,int size){
  if (a.length == size) {
    return a;
  }
 else {
    float[] b=new float[size];
    System.arraycopy(a,0,b,0,size);
    return b;
  }
}

public static final float [ ] trim ( float [ ] a , int size ) { if ( a . length == size ) { return a ; } else { float [ ] b = new float [ size ] ; System . arraycopy ( a , 0 , b , 0 , size ) ; return b ; } }
trims an array to be exactly the target a size .
