if (mOffset == nsUint64(0)) {
if (mOffset != nsUint64(0)) {
nsInputStreamTransport::Read(char *buf, PRUint32 count, PRUint32 *result){    if (mFirstTime) {        mFirstTime = PR_FALSE;        if (mOffset == nsUint64(0)) {            // read from current position if offset equal to max            if (mOffset != LL_MAXUINT) {                nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mSource);                // Note: The casts to PRUint64 are needed to cast to PRInt64, as                // nsUint64 can't directly be cast to PRInt64                if (seekable)                    seekable->Seek(nsISeekableStream::NS_SEEK_SET, PRUint64(mOffset));            }            // reset offset to zero so we can use it to enforce limit            mOffset = 0;        }    }    // limit amount read    PRUint32 max = mLimit - mOffset;    if (max == 0) {        *result = 0;        return NS_OK;    }            if (count > max)        count = max;    nsresult rv = mSource->Read(buf, count, result);    if (NS_SUCCEEDED(rv)) {        mOffset += *result;        if (mEventSink)            mEventSink->OnTransportStatus(this, STATUS_READING, mOffset, mLimit);    }    return rv;}