Here you can find the source of arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len)
public static boolean arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len) { if (off1 + len > a1.length) return false; if (off2 + len > a2.length) return false; for (int i = 0; i < len; i++) if (a1[off1 + i] != a2[off2 + i]) return false; return true; }/* w ww . j ava 2s. co m*/ }