memcpy(aBuf + aOffset, mUnicharData->GetBuffer() + mUnicharDataOffset, rv * sizeof(PRUnichar)); mUnicharDataOffset += rv; *aReadCount = rv;
memcpy(aBuf, us + mPos, sizeof(PRUnichar) * amount); mPos += amount; *aReadCount = amount;
nsresult UTF8InputStream::Read(PRUnichar* aBuf,                               PRUint32 aOffset,                               PRUint32 aCount,                               PRUint32 *aReadCount){  NS_ASSERTION(mUnicharDataLength >= mUnicharDataOffset, "unsigned madness");  PRUint32 rv = mUnicharDataLength - mUnicharDataOffset;  nsresult errorCode;  if (0 == rv) {    // Fill the unichar buffer    rv = Fill(&errorCode);    if (rv <= 0) {      *aReadCount = 0;      return errorCode;    }  }  if (rv > aCount) {    rv = aCount;  }  memcpy(aBuf + aOffset, mUnicharData->GetBuffer() + mUnicharDataOffset,         rv * sizeof(PRUnichar));  mUnicharDataOffset += rv;  *aReadCount = rv;  return NS_OK;}