code: public static int findBytes(byte [] utf, int start, int end, byte[] b) {
      int matchEnd = end - b.length;
      for(int i=start; i<=matchEnd; i++) {
        boolean matched = true;
        for(int j=0; j<b.length; j++) {
          if (utf[i+j] != b[j]) {
            matched = false;
            break;
          }
        }
        if (matched) {
          return i;
        }
      }
      return -1;      
    }
docs: Find the first occurrence of the given bytes b in a UTF-8 encoded string
  @param utf a byte array containing a UTF-8 encoded string
  @param start starting offset
  @param end ending position
  @param b the bytes to find
  @return position that first byte occures otherwise -1