System.Runtime.Serialization.Json.XmlJsonWriter.WriteChars C# (CSharp) Method

WriteChars() public method

public WriteChars ( char buffer, int index, int count ) : void
buffer char
index int
count int
return void
        public override void WriteChars(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));
        }