PRInt32 ConverterInputStream::Fill(nsresult * aErrorCode)
PRInt32 UTF8InputStream::Fill(nsresult * aErrorCode)
PRInt32 ConverterInputStream::Fill(nsresult * aErrorCode){  if (nsnull == mInput) {    // We already closed the stream!    *aErrorCode = NS_BASE_STREAM_CLOSED;    return -1;  }  NS_ASSERTION(mByteData->GetLength() >= mByteDataOffset, "unsigned madness");  PRUint32 remainder = mByteData->GetLength() - mByteDataOffset;  mByteDataOffset = remainder;  PRInt32 nb = mByteData->Fill(aErrorCode, mInput, remainder);  if (nb <= 0) {    // Because we assume a many to one conversion, the lingering data    // in the byte buffer must be a partial conversion    // fragment. Because we know that we have recieved no more new    // data to add to it, we can't convert it. Therefore, we discard    // it.    return nb;  }  NS_ASSERTION(remainder + nb == mByteData->GetLength(), "bad nb");  // Now convert as much of the byte buffer to unicode as possible  PRInt32 dstLen = mUnicharData->GetBufferSize();  PRInt32 srcLen = remainder + nb;  *aErrorCode = mConverter->Convert(mByteData->GetBuffer(), &srcLen,                                    mUnicharData->GetBuffer(), &dstLen);  mUnicharDataOffset = 0;  mUnicharDataLength = dstLen;  mByteDataOffset += srcLen;  return dstLen;}