public override void WriteRaw(char[] buffer, int index, int count)
{
if (buffer == null)
{
throw new ArgumentNullException(nameof(buffer));
}
// Not checking upper bound because it will be caught by "count". This is what XmlTextWriter does.
if (index < 0)
{
throw new ArgumentOutOfRangeException(nameof(index), SR.ValueMustBeNonNegative);
}
if (count < 0)
{
throw new ArgumentOutOfRangeException(nameof(count), SR.ValueMustBeNonNegative);
}
if (count > buffer.Length - index)
{
throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.JsonSizeExceedsRemainingBufferSpace, buffer.Length - index));
}
WriteString(new string(buffer, index, count));
}