Here you can find the source of shiftRight(T[] array)
public static <T> void shiftRight(T[] array)
//package com.java2s; /**/*from w w w. j a v a 2 s. c om*/ * This class is part of JCodec ( www.jcodec.org ) This software is distributed * under FreeBSD License * * @author Jay Codec * */ public class Main { public static <T> void shiftRight(T[] array) { for (int i = 1; i < array.length; i++) { array[i] = array[i - 1]; } array[0] = null; } public static <T> void shiftRight(T[] array, int from, int to) { for (int i = to - 1; i > from; i--) { array[i] = array[i - 1]; } array[from] = null; } public static <T> void shiftRight(T[] array, int to) { shiftRight(array, 0, to); } }