public static InputStream openUrlStream(String url) {
    { String protocol = null;
      String userInfo = null;
      String host = null;
      String port = null;
      String path = null;
      String query = null;
      String fragment = null;

      { Object [] caller_MV_returnarray = new Object[6];

        protocol = Http.decomposeInternetUrl(url, caller_MV_returnarray);
        userInfo = ((String)(((StringWrapper)(caller_MV_returnarray[0])).wrapperValue));
        host = ((String)(((StringWrapper)(caller_MV_returnarray[1])).wrapperValue));
        port = ((String)(((StringWrapper)(caller_MV_returnarray[2])).wrapperValue));
        path = ((String)(((StringWrapper)(caller_MV_returnarray[3])).wrapperValue));
        query = ((String)(((StringWrapper)(caller_MV_returnarray[4])).wrapperValue));
        fragment = ((String)(((StringWrapper)(caller_MV_returnarray[5])).wrapperValue));
      }
      { String testValue000 = Native.stringDowncase(protocol);

        if (Stella.stringEqlP(testValue000, "http")) {
          if (!Stella.stringEqlP(userInfo, "")) {
            { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print("open-url-stream: only URLs without user information are supported: `" + url + "'");
              throw ((BadArgumentException)(BadArgumentException.newBadArgumentException(stream000.theStringReader()).fillInStackTrace()));
            }
          }
          else {
            { int theport = Http.HTTP_DEFAULT_PORT;
              String thepath = Http.composeInternetUrl("", "", "", Stella.NULL_INTEGER, path, query, fragment);

              if (!(Stella.blankStringP(port))) {
                theport = ((int)(Native.stringToInteger(port)));
              }
              return (Http.httpGetData(host, theport, thepath, null));
            }
          }
        }
        else if (Stella.stringEqlP(testValue000, "file")) {
          if (!Stella.stringEqlP(userInfo, "")) {
            { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

              stream001.nativeStream.print("open-url-stream: only URLs without user information are supported: `" + url + "'");
              throw ((BadArgumentException)(BadArgumentException.newBadArgumentException(stream001.theStringReader()).fillInStackTrace()));
            }
          }
          else if (Stella.blankStringP(host) ||
              Stella.stringEqlP(host, "localhost")) {
            return (InputFileStream.newInputFileStream(Http.urlPathToFilename(path)));
          }
          else {
            { OutputStringStream stream002 = OutputStringStream.newOutputStringStream();

              stream002.nativeStream.print("open-url-stream: only absolute file URLs on the local host are supported: `" + url + "'");
              throw ((BadArgumentException)(BadArgumentException.newBadArgumentException(stream002.theStringReader()).fillInStackTrace()));
            }
          }
        }
        else {
          { OutputStringStream stream003 = OutputStringStream.newOutputStringStream();

            stream003.nativeStream.print("open-url-stream: only http and file URLs are supported: `" + url + "'");
            throw ((BadArgumentException)(BadArgumentException.newBadArgumentException(stream003.theStringReader()).fillInStackTrace()));
          }
        }
      }
    }
  }