public static String composeInternetUrl(String protocol, String userinfo, String host, int port, String path, String query, String fragment) {
    { OutputStringStream url = OutputStringStream.newOutputStringStream();

      if (!(Stella.blankStringP(protocol))) {
        url.nativeStream.print(protocol + "://");
      }
      if (!(Stella.blankStringP(userinfo))) {
        url.nativeStream.print(userinfo + "@");
      }
      if (!(Stella.blankStringP(host))) {
        url.nativeStream.print(host);
      }
      if (port != Stella.NULL_INTEGER) {
        url.nativeStream.print(":" + port);
      }
      if (!(Stella.blankStringP(path))) {
        if (Stella.startsWithP(path, "/", 0)) {
          url.nativeStream.print(path);
        }
        else {
          url.nativeStream.print("/" + path);
        }
      }
      if (!(Stella.blankStringP(query))) {
        url.nativeStream.print("?" + query);
      }
      if (!(Stella.blankStringP(fragment))) {
        url.nativeStream.print("#" + fragment);
      }
      return (url.theStringReader());
    }
  }