public override void WriteChars(char[] chars, int offset, int count)
{
if (IsClosed)
ThrowClosed();
if (chars == null)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(chars)));
// Not checking upper bound because it will be caught by "count". This is what XmlTextWriter does.
if (offset < 0)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(offset), SR.Format(SR.ValueMustBeNonNegative)));
if (count < 0)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.ValueMustBeNonNegative)));
if (count > chars.Length - offset)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.SizeExceedsRemainingBufferSpace, chars.Length - offset)));
if (count > 0)
{
FlushBase64();
if (_attributeValue != null)
WriteAttributeText(new string(chars, offset, count));
if (!_isXmlnsAttribute)
{
StartContent(chars, offset, count);
_writer.WriteEscapedText(chars, offset, count);
EndContent();
}
}
}