nsresult rv = storageStream->Init(segmentSize, maxSize); if (NS_FAILED(rv)) { NS_RELEASE(storageStream); return rv; }
NS_NewStorageStream(PRUint32 segmentSize, PRUint32 maxSize, nsIStorageStream **result){    NS_ENSURE_ARG(result);    nsStorageStream* storageStream = new nsStorageStream();    if (!storageStream) return NS_ERROR_OUT_OF_MEMORY;        storageStream->Init(segmentSize, maxSize);    NS_ADDREF(storageStream);    *result = storageStream;    return NS_OK;}