Here you can find the source of reverse(byte[] byteArray)
public static byte[] reverse(byte[] byteArray)
//package com.java2s; public class Main { public static byte[] reverse(byte[] byteArray) { byte[] rev = new byte[byteArray.length]; for (int i = 0; i < byteArray.length; i++) { rev[byteArray.length - (i + 1)] = byteArray[i]; }//from w ww. ja v a 2 s. co m return rev; } }