code: 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;
      }
docs: Checks to see if the wanted byte pattern is found in the
  within bytes from the given offset
  @param wanted Byte sequence to look for
  @param within Bytes to find in
  @param withinOffset Offset to check from