public static float[] rshift(float[] field,int offset,int size,int shiftCount,boolean expandIfNeeded){
  if (field == null) {
    throw new IllegalArgumentException("the field argument must not be null");
  }
  if (offset < 0 || offset >= field.length) {
    throw new IllegalArgumentException("the offset argument must be in range 0 >= offset < field.length");
  }
  size=Math.min(field.length - offset,size);
  int to=offset + size + shiftCount;
  int from=offset + size;
  if (to > field.length) {
    if (expandIfNeeded) {
      field=expand(field,to,true);
    }
 else {
      to=field.length;
      from=field.length - shiftCount;
    }
  }
  while (from > offset) {
    field[--to]=field[--from];
  }
  return field;
}

public static float [ ] rshift ( float [ ] field , int offset , int size , int shiftCount , boolean expandIfNeeded ) { if ( field == null ) { throw new IllegalArgumentException ( "the field argument must not be null" ) ; } if ( offset < 0 || offset >= field . length ) { throw new IllegalArgumentException ( "the offset argument must be in range 0 >= offset < field.length" ) ; } size = Math . min ( field . length - offset , size ) ; int to = offset + size + shiftCount ; int from = offset + size ; if ( to > field . length ) { if ( expandIfNeeded ) { field = expand ( field , to , true ) ; } else { to = field . length ; from = field . length - shiftCount ; } } while ( from > offset ) { field [ -- to ] = field [ -- from ] ; } return field ; }
this method shifts a part of an array to the right
