Here you can find the source of compare(byte[] as, byte[] bs)
public static boolean compare(byte[] as, byte[] bs)
//package com.java2s; public class Main { public static boolean compare(byte[] as, byte[] bs) { boolean result = true; int len = as.length; if (len != bs.length) { return false; }//w ww .j a va 2 s .c o m for (int i = 0; i < len; i++) { if (as[i] != bs[i]) { result = false; return result; } } return result; } }