Here you can find the source of flip(T[] array)
public static <T> T[] flip(T[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static <T> T[] flip(T[] array) { T[] tmp = array.clone();/* ww w .j av a 2 s. c o m*/ for (int i = 0; i < array.length; i++) { tmp[i] = array[array.length - i]; } return tmp; } public static byte[] flip(byte[] array) { byte[] tmp = array.clone(); for (int i = 0; i < array.length; i++) tmp[i] = array[array.length - 1]; return tmp; } }