public static boolean byteRangeMatches ( byte [ ] wanted , byte [ ] within , int withinOffset ) { for ( int i = 0 ; i < wanted . length ; i ++ ) { if ( wanted [ i ] != within [ i + withinOffset ] ) return false ; } return true ; }
Checks to see if the wanted byte pattern is found in the within bytes from the given offset