381812 make it possible to get storage input streams for empty streams r=bsmedberg

This commit is contained in:
cbiesinger@gmx.at 2007-08-17 13:27:50 -07:00
parent 10ea784eab
commit 07c4078d63

View File

@ -384,7 +384,6 @@ NS_IMETHODIMP
nsStorageStream::NewInputStream(PRInt32 aStartingOffset, nsIInputStream* *aInputStream)
{
NS_ENSURE_TRUE(mSegmentedBuffer, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(mSegmentedBuffer->GetSegmentCount(), NS_ERROR_NOT_INITIALIZED);
nsStorageInputStream *inputStream = new nsStorageInputStream(this, mSegmentSize);
if (!inputStream)
@ -534,6 +533,9 @@ nsStorageInputStream::Seek(PRUint32 aPosition)
if (aPosition > length)
return NS_ERROR_INVALID_ARG;
if (length == 0)
return NS_OK;
mSegmentNum = SegNum(aPosition);
PRUint32 segmentOffset = SegOffset(aPosition);
mReadCursor = mStorageStream->mSegmentedBuffer->GetSegment(mSegmentNum) +