Here you can find the source of rangeEquals(byte[] a, int aStart, byte[] b, int bStart, int length)
public static boolean rangeEquals(byte[] a, int aStart, byte[] b, int bStart, int length)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean rangeEquals(byte[] a, int aStart, byte[] b, int bStart, int length) { assert a.length - aStart > length && b.length - bStart > length; for (int i = aStart, j = bStart, k = 0; k < length; k++) { if (a[i] != b[j]) return false; }//from w ww . java 2 s. c o m return true; } }