Here you can find the source of bytesEqual(byte[] a, byte[] b, int len)
public static boolean bytesEqual(byte[] a, byte[] b, int len)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean bytesEqual(byte[] a, byte[] b, int len) { if (a == null && b == null) return true; if (a == null || b == null) return false; if (a.length < len || b.length < len) return false; for (int i = 0; i < len; i++) if (a[i] != b[i]) return false; return true; }//ww w. ja va2s. co m }