docs: private static String encodePath(final String path) {
          // Accept ':' if it is part of a scheme prefix
          int validColonPrefixLen = 0;
          for (final String scheme : SCHEME_PREFIXES) {
              if (path.startsWith(scheme)) {
                  validColonPrefixLen = scheme.length();
                  break;
              }
          }
          final byte[] pathBytes = path.getBytes(StandardCharsets.UTF_8);
          final StringBuilder encodedPath = new StringBuilder(pathBytes.length * 3);
          for (int i = 0; i < pathBytes.length; i++) {
              final byte pathByte = pathBytes[i];
              final int b = pathByte & 0xff;
              if (safe[b] || (b == ':' && i < validColonPrefixLen)) {
                  encodedPath.append((char) b);
              } else {
                  encodedPath.append('%');
                  encodedPath.append(HEXADECIMAL[(b & 0xf0) >> 4]);
                  encodedPath.append(HEXADECIMAL[b & 0x0f]);
              }
          }
          return encodedPath.toString();
      }