def init(self, url, mode="r"):
        self.close()
        if mode != "r":
            raise ValueError, "only 'r' mode supported'"
        io_service = components.classes["@mozilla.org/network/io-service;1"] \
                        .getService(components.interfaces.nsIIOService)
        if hasattr(url, "queryInterface"):
            url_ob = url
        else:
            url_ob = io_service.newURI(url, None, None)
        # Mozilla asserts and starts saying "NULL POINTER" if this is wrong!
        if not url_ob.scheme:
            raise ValueError, ("The URI '%s' is invalid (no scheme)" 
                                  % (url_ob.spec,))
        self.channel = io_service.newChannelFromURI(url_ob)
        self.inputStream = self.channel.open()