public override unsafe int GetBytes(char *chars, int charCount, byte *bytes, int byteCount, bool flush)
{
// Validate parameters
if (chars == null || bytes == null)
{
throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), SR.ArgumentNull_Array);
}
if (byteCount < 0 || charCount < 0)
{
throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), SR.ArgumentOutOfRange_NeedNonNegNum);
}
m_mustFlush = flush;
m_throwOnOverflow = true;
return(m_encoding.GetBytes(chars, charCount, bytes, byteCount, this));
}