Here you can find the source of array_equals(byte[] foo, byte bar[])
static boolean array_equals(byte[] foo, byte bar[])
//package com.java2s; public class Main { static boolean array_equals(byte[] foo, byte bar[]) { int i = foo.length; if (i != bar.length) return false; for (int j = 0; j < i; j++) { if (foo[j] != bar[j]) return false; }//from www.j a va 2 s . co m //try{while(true){i--; if(foo[i]!=bar[i])return false;}}catch(Exception e){} return true; } }