return NS_NewCStringInputStream(result, data);
nsCOMPtr<nsIStringInputStream> stream (do_CreateInstance("@mozilla.org/io/string-input-stream;1", &rv)); if (NS_FAILED(rv)) return rv;  rv = stream->SetData(data.BeginReading(), data.Length()); if (NS_FAILED(rv)) return rv;  NS_ADDREF(*result = stream); return NS_OK;
NS_NewPostDataStream(nsIInputStream  **result,                     PRBool            isFile,                     const nsACString &data,                     PRUint32          encodeFlags,                     nsIIOService     *unused = nsnull){    if (isFile) {        nsresult rv;        nsCOMPtr<nsILocalFile> file;        nsCOMPtr<nsIInputStream> fileStream;        rv = NS_NewNativeLocalFile(data, PR_FALSE, getter_AddRefs(file));        if (NS_SUCCEEDED(rv)) {            rv = NS_NewLocalFileInputStream(getter_AddRefs(fileStream), file);            if (NS_SUCCEEDED(rv)) {                // wrap the file stream with a buffered input stream                rv = NS_NewBufferedInputStream(result, fileStream, 8192);            }        }        return rv;    }    // otherwise, create a string stream for the data (copies)    return NS_NewCStringInputStream(result, data);}