public override void WriteChars(char[] buffer, int index, int count)
{
try
{
if (buffer == null)
{
throw new ArgumentNullException(nameof(buffer));
}
if (index < 0)
{
throw new ArgumentOutOfRangeException(nameof(index));
}
if (count < 0)
{
throw new ArgumentOutOfRangeException(nameof(count));
}
if (count > buffer.Length - index)
{
throw new ArgumentOutOfRangeException(nameof(count));
}
AdvanceState(Token.Text);
if (SaveAttrValue)
{
_attrValueCache.WriteChars(buffer, index, count);
}
else
{
_writer.WriteChars(buffer, index, count);
}
}
catch
{
_currentState = State.Error;
throw;
}
}