28412 metaDataLength is wrong in nsCachedNetData::Deserialize. Add routines to build stream from char* and length
git-svn-id: svn://10.0.0.236/trunk@66416 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -493,3 +493,25 @@ extern "C" NS_COM nsresult NS_NewCharIOStream(
|
||||
{
|
||||
return NS_NewCharOutputStream(aStreamResult, aStringToChange);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
extern "C" NS_COM nsresult NS_NewByteInputStream(
|
||||
nsISupports** aStreamResult,
|
||||
const char* aStringToRead,
|
||||
PRInt32 aLength)
|
||||
// Factory method to get an nsInputStream from a string. Result will implement all the
|
||||
// file stream interfaces in nsIFileStream.h
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
NS_PRECONDITION(aStreamResult != nsnull, "null ptr");
|
||||
if (! aStreamResult)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
ConstCharImpl* stream = new ConstCharImpl(aStringToRead, aLength);
|
||||
if (! stream)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
NS_ADDREF(stream);
|
||||
*aStreamResult = (nsISupports*)(void*)stream;
|
||||
return NS_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user