public override void WriteWhitespace(string whitespace)
{
if (IsClosed)
ThrowClosed();
if (whitespace == null)
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(whitespace));
for (int i = 0; i < whitespace.Length; ++i)
{
char c = whitespace[i];
if (c != ' ' &&
c != '\t' &&
c != '\n' &&
c != '\r')
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.Format(SR.XmlOnlyWhitespace), nameof(whitespace)));
}
WriteString(whitespace);
}