class ByteUtil {

    public static int matchingNibbleLength(byte[] a, byte[] b) {
        int i = 0;
        int length = a.length < b.length ? a.length : b.length;
        while (i < length) {
        	if (a[i] != b[i])
        		break;
            i++;
        }
        return i;
    }

}