docs: static private boolean matchesStringAtIndex(char[] buf, int index, String str) {
          int strLength = str.length();
          if (index + strLength > buf.length) {
              return false;
          }
  
          for (int i = 0; i < strLength; ++i) {
              if (buf[index + i] != str.charAt(i)) {
                  return false;
              }
          }
  
          return true;
      }