Here you can find the source of areEquals(byte[] g1, byte[] g2)
public static boolean areEquals(byte[] g1, byte[] g2)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean areEquals(byte[] g1, byte[] g2) { if ((g1 == null && g2 == null) || (g1 == null && g2.length == 0) || (g2 == null && g1.length == 0)) return true; boolean b = true; for (int i = 0; i < g1.length; i++) b = b && g1[i] == g2[i]; return b; }/* w w w . j ava2 s .c om*/ }