Here you can find the source of Shift(int[] in, int amt, int spare)
public static final void Shift(int[] in, int amt, int spare)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static final void Shift(int[] in, int amt, int spare) { if (amt > 0) { System.arraycopy(in, 0, in, amt, in.length - amt); Arrays.fill(in, 0, amt, spare); } else if (amt < 0) { System.arraycopy(in, -amt, in, 0, in.length + amt); Arrays.fill(in, in.length + amt, in.length, spare); }/*from w w w . j av a2 s .c om*/ } public static final void Shift(int[][] in, int amt, int spare) { for (int i = 0, s = in.length; i < s; i++) Shift(in[i], amt, spare); } }