if (pipe->mWriteCursor) len -= pipe->mWriteLimit - pipe->mWriteCursor; return len;
if (result) *result = len; return NS_OK;
nsPipe::nsPipeInputStream::GetLength(PRUint32 *result){    nsPipe* pipe = GET_INPUTSTREAM_PIPE(this);    nsAutoCMonitor mon(pipe);    PRUint32 len = pipe->mBuffer.GetSize();    if (pipe->mReadCursor) {        char* end = (pipe->mReadLimit == pipe->mWriteLimit)            ? pipe->mWriteCursor            : pipe->mReadLimit;        len -= pipe->mBuffer.GetSegmentSize() - (end - pipe->mReadCursor);    }    if (pipe->mWriteCursor)        len -= pipe->mWriteLimit - pipe->mWriteCursor;    return len;}