using System; using System.Runtime.InteropServices; using System.Text; namespace System.IO { /// Represents a writer that can write a sequential series of characters. This class is abstract. /// 2 // Token: 0x020001D6 RID: 470 [ComVisible(true)] [Serializable] public abstract class TextWriter : IDisposable { /// Initializes a new instance of the class. // Token: 0x06001806 RID: 6150 RVA: 0x0005C68C File Offset: 0x0005A88C protected TextWriter() { this.CoreNewLine = Environment.NewLine.ToCharArray(); } /// Initializes a new instance of the class with the specified format provider. /// An object that controls formatting. // Token: 0x06001807 RID: 6151 RVA: 0x0005C6A4 File Offset: 0x0005A8A4 protected TextWriter(IFormatProvider formatProvider) { this.CoreNewLine = Environment.NewLine.ToCharArray(); this.internalFormatProvider = formatProvider; } /// When overridden in a derived class, returns the in which the output is written. /// The Encoding in which the output is written. /// 1 // Token: 0x1700043C RID: 1084 // (get) Token: 0x06001809 RID: 6153 public abstract Encoding Encoding { get; } /// Gets an object that controls formatting. /// An object for a specific culture, or the formatting of the current culture if no other culture is specified. /// 2 // Token: 0x1700043D RID: 1085 // (get) Token: 0x0600180A RID: 6154 RVA: 0x0005C6D0 File Offset: 0x0005A8D0 public virtual IFormatProvider FormatProvider { get { return this.internalFormatProvider; } } /// Gets or sets the line terminator string used by the current TextWriter. /// The line terminator string for the current TextWriter. /// 2 // Token: 0x1700043E RID: 1086 // (get) Token: 0x0600180B RID: 6155 RVA: 0x0005C6D8 File Offset: 0x0005A8D8 // (set) Token: 0x0600180C RID: 6156 RVA: 0x0005C6E8 File Offset: 0x0005A8E8 public virtual string NewLine { get { return new string(this.CoreNewLine); } set { if (value == null) { value = Environment.NewLine; } this.CoreNewLine = value.ToCharArray(); } } /// Closes the current writer and releases any system resources associated with the writer. /// 1 // Token: 0x0600180D RID: 6157 RVA: 0x0005C704 File Offset: 0x0005A904 public virtual void Close() { this.Dispose(true); } /// Releases the unmanaged resources used by the and optionally releases the managed resources. /// true to release both managed and unmanaged resources; false to release only unmanaged resources. // Token: 0x0600180E RID: 6158 RVA: 0x0005C710 File Offset: 0x0005A910 protected virtual void Dispose(bool disposing) { if (disposing) { GC.SuppressFinalize(this); } } /// Releases all resources used by the object. // Token: 0x0600180F RID: 6159 RVA: 0x0005C720 File Offset: 0x0005A920 public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } /// Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. /// 1 // Token: 0x06001810 RID: 6160 RVA: 0x0005C730 File Offset: 0x0005A930 public virtual void Flush() { } /// Creates a thread-safe wrapper around the specified TextWriter. /// A thread-safe wrapper. /// The TextWriter to synchronize. /// /// is null. /// 2 // Token: 0x06001811 RID: 6161 RVA: 0x0005C734 File Offset: 0x0005A934 public static TextWriter Synchronized(TextWriter writer) { return TextWriter.Synchronized(writer, false); } // Token: 0x06001812 RID: 6162 RVA: 0x0005C740 File Offset: 0x0005A940 internal static TextWriter Synchronized(TextWriter writer, bool neverClose) { if (writer == null) { throw new ArgumentNullException("writer is null"); } if (writer is SynchronizedWriter) { return writer; } return new SynchronizedWriter(writer, neverClose); } /// Writes the text representation of a Boolean value to the text stream. /// The Boolean to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001813 RID: 6163 RVA: 0x0005C768 File Offset: 0x0005A968 public virtual void Write(bool value) { this.Write(value.ToString()); } /// Writes a character to the text stream. /// The character to write to the text stream. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001814 RID: 6164 RVA: 0x0005C778 File Offset: 0x0005A978 public virtual void Write(char value) { } /// Writes a character array to the text stream. /// The character array to write to the text stream. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001815 RID: 6165 RVA: 0x0005C77C File Offset: 0x0005A97C public virtual void Write(char[] buffer) { if (buffer == null) { return; } this.Write(buffer, 0, buffer.Length); } /// Writes the text representation of a decimal value to the text stream. /// The decimal value to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001816 RID: 6166 RVA: 0x0005C790 File Offset: 0x0005A990 public virtual void Write(decimal value) { this.Write(value.ToString(this.internalFormatProvider)); } /// Writes the text representation of an 8-byte floating-point value to the text stream. /// The 8-byte floating-point value to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001817 RID: 6167 RVA: 0x0005C7A8 File Offset: 0x0005A9A8 public virtual void Write(double value) { this.Write(value.ToString(this.internalFormatProvider)); } /// Writes the text representation of a 4-byte signed integer to the text stream. /// The 4-byte signed integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001818 RID: 6168 RVA: 0x0005C7C0 File Offset: 0x0005A9C0 public virtual void Write(int value) { this.Write(value.ToString(this.internalFormatProvider)); } /// Writes the text representation of an 8-byte signed integer to the text stream. /// The 8-byte signed integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001819 RID: 6169 RVA: 0x0005C7D8 File Offset: 0x0005A9D8 public virtual void Write(long value) { this.Write(value.ToString(this.internalFormatProvider)); } /// Writes the text representation of an object to the text stream by calling ToString on that object. /// The object to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600181A RID: 6170 RVA: 0x0005C7F0 File Offset: 0x0005A9F0 public virtual void Write(object value) { if (value != null) { this.Write(value.ToString()); } } /// Writes the text representation of a 4-byte floating-point value to the text stream. /// The 4-byte floating-point value to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600181B RID: 6171 RVA: 0x0005C804 File Offset: 0x0005AA04 public virtual void Write(float value) { this.Write(value.ToString(this.internalFormatProvider)); } /// Writes a string to the text stream. /// The string to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600181C RID: 6172 RVA: 0x0005C81C File Offset: 0x0005AA1C public virtual void Write(string value) { if (value != null) { this.Write(value.ToCharArray()); } } /// Writes the text representation of a 4-byte unsigned integer to the text stream. /// The 4-byte unsigned integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600181D RID: 6173 RVA: 0x0005C830 File Offset: 0x0005AA30 [CLSCompliant(false)] public virtual void Write(uint value) { this.Write(value.ToString(this.internalFormatProvider)); } /// Writes the text representation of an 8-byte unsigned integer to the text stream. /// The 8-byte unsigned integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600181E RID: 6174 RVA: 0x0005C848 File Offset: 0x0005AA48 [CLSCompliant(false)] public virtual void Write(ulong value) { this.Write(value.ToString(this.internalFormatProvider)); } /// Writes out a formatted string, using the same semantics as . /// The formatting string. /// An object to write into the formatted string. /// /// is null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted. /// 1 // Token: 0x0600181F RID: 6175 RVA: 0x0005C860 File Offset: 0x0005AA60 public virtual void Write(string format, object arg0) { this.Write(string.Format(format, arg0)); } /// Writes out a formatted string, using the same semantics as . /// The formatting string. /// The object array to write into the formatted string. /// /// or is null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to . Length. /// 1 // Token: 0x06001820 RID: 6176 RVA: 0x0005C870 File Offset: 0x0005AA70 public virtual void Write(string format, params object[] arg) { this.Write(string.Format(format, arg)); } /// Writes a subarray of characters to the text stream. /// The character array to write data from. /// Starting index in the buffer. /// The number of characters to write. /// The buffer length minus is less than . /// The parameter is null. /// /// or is negative. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001821 RID: 6177 RVA: 0x0005C880 File Offset: 0x0005AA80 public virtual void Write(char[] buffer, int index, int count) { if (buffer == null) { throw new ArgumentNullException("buffer"); } if (index < 0 || index > buffer.Length) { throw new ArgumentOutOfRangeException("index"); } if (count < 0 || index > buffer.Length - count) { throw new ArgumentOutOfRangeException("count"); } while (count > 0) { this.Write(buffer[index]); count--; index++; } } /// Writes out a formatted string, using the same semantics as . /// The formatting string. /// An object to write into the formatted string. /// An object to write into the formatted string. /// /// is null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted. /// 1 // Token: 0x06001822 RID: 6178 RVA: 0x0005C8F8 File Offset: 0x0005AAF8 public virtual void Write(string format, object arg0, object arg1) { this.Write(string.Format(format, arg0, arg1)); } /// Writes out a formatted string, using the same semantics as . /// The formatting string. /// An object to write into the formatted string. /// An object to write into the formatted string. /// An object to write into the formatted string. /// /// is null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted. /// 1 // Token: 0x06001823 RID: 6179 RVA: 0x0005C908 File Offset: 0x0005AB08 public virtual void Write(string format, object arg0, object arg1, object arg2) { this.Write(string.Format(format, arg0, arg1, arg2)); } /// Writes a line terminator to the text stream. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001824 RID: 6180 RVA: 0x0005C91C File Offset: 0x0005AB1C public virtual void WriteLine() { this.Write(this.CoreNewLine); } /// Writes the text representation of a Boolean followed by a line terminator to the text stream. /// The Boolean to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001825 RID: 6181 RVA: 0x0005C92C File Offset: 0x0005AB2C public virtual void WriteLine(bool value) { this.Write(value); this.WriteLine(); } /// Writes a character followed by a line terminator to the text stream. /// The character to write to the text stream. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001826 RID: 6182 RVA: 0x0005C93C File Offset: 0x0005AB3C public virtual void WriteLine(char value) { this.Write(value); this.WriteLine(); } /// Writes an array of characters followed by a line terminator to the text stream. /// The character array from which data is read. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001827 RID: 6183 RVA: 0x0005C94C File Offset: 0x0005AB4C public virtual void WriteLine(char[] buffer) { this.Write(buffer); this.WriteLine(); } /// Writes the text representation of a decimal value followed by a line terminator to the text stream. /// The decimal value to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001828 RID: 6184 RVA: 0x0005C95C File Offset: 0x0005AB5C public virtual void WriteLine(decimal value) { this.Write(value); this.WriteLine(); } /// Writes the text representation of a 8-byte floating-point value followed by a line terminator to the text stream. /// The 8-byte floating-point value to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001829 RID: 6185 RVA: 0x0005C96C File Offset: 0x0005AB6C public virtual void WriteLine(double value) { this.Write(value); this.WriteLine(); } /// Writes the text representation of a 4-byte signed integer followed by a line terminator to the text stream. /// The 4-byte signed integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600182A RID: 6186 RVA: 0x0005C97C File Offset: 0x0005AB7C public virtual void WriteLine(int value) { this.Write(value); this.WriteLine(); } /// Writes the text representation of an 8-byte signed integer followed by a line terminator to the text stream. /// The 8-byte signed integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600182B RID: 6187 RVA: 0x0005C98C File Offset: 0x0005AB8C public virtual void WriteLine(long value) { this.Write(value); this.WriteLine(); } /// Writes the text representation of an object by calling ToString on this object, followed by a line terminator to the text stream. /// The object to write. If is null, only the line termination characters are written. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600182C RID: 6188 RVA: 0x0005C99C File Offset: 0x0005AB9C public virtual void WriteLine(object value) { this.Write(value); this.WriteLine(); } /// Writes the text representation of a 4-byte floating-point value followed by a line terminator to the text stream. /// The 4-byte floating-point value to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600182D RID: 6189 RVA: 0x0005C9AC File Offset: 0x0005ABAC public virtual void WriteLine(float value) { this.Write(value); this.WriteLine(); } /// Writes a string followed by a line terminator to the text stream. /// The string to write. If is null, only the line termination characters are written. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600182E RID: 6190 RVA: 0x0005C9BC File Offset: 0x0005ABBC public virtual void WriteLine(string value) { this.Write(value); this.WriteLine(); } /// Writes the text representation of a 4-byte unsigned integer followed by a line terminator to the text stream. /// The 4-byte unsigned integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x0600182F RID: 6191 RVA: 0x0005C9CC File Offset: 0x0005ABCC [CLSCompliant(false)] public virtual void WriteLine(uint value) { this.Write(value); this.WriteLine(); } /// Writes the text representation of an 8-byte unsigned integer followed by a line terminator to the text stream. /// The 8-byte unsigned integer to write. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001830 RID: 6192 RVA: 0x0005C9DC File Offset: 0x0005ABDC [CLSCompliant(false)] public virtual void WriteLine(ulong value) { this.Write(value); this.WriteLine(); } /// Writes out a formatted string and a new line, using the same semantics as . /// The formatted string. /// The object to write into the formatted string. /// /// is null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted. /// 1 // Token: 0x06001831 RID: 6193 RVA: 0x0005C9EC File Offset: 0x0005ABEC public virtual void WriteLine(string format, object arg0) { this.Write(format, arg0); this.WriteLine(); } /// Writes out a formatted string and a new line, using the same semantics as . /// The formatting string. /// The object array to write into format string. /// A string or object is passed in as null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to arg.Length. /// 1 // Token: 0x06001832 RID: 6194 RVA: 0x0005C9FC File Offset: 0x0005ABFC public virtual void WriteLine(string format, params object[] arg) { this.Write(format, arg); this.WriteLine(); } /// Writes a subarray of characters followed by a line terminator to the text stream. /// The character array from which data is read. /// The index into at which to begin reading. /// The maximum number of characters to write. /// The buffer length minus is less than . /// The parameter is null. /// /// or is negative. /// The is closed. /// An I/O error occurs. /// 1 // Token: 0x06001833 RID: 6195 RVA: 0x0005CA0C File Offset: 0x0005AC0C public virtual void WriteLine(char[] buffer, int index, int count) { this.Write(buffer, index, count); this.WriteLine(); } /// Writes out a formatted string and a new line, using the same semantics as . /// The formatting string. /// The object to write into the format string. /// The object to write into the format string. /// /// is null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted. /// 1 // Token: 0x06001834 RID: 6196 RVA: 0x0005CA20 File Offset: 0x0005AC20 public virtual void WriteLine(string format, object arg0, object arg1) { this.Write(format, arg0, arg1); this.WriteLine(); } /// Writes out a formatted string and a new line, using the same semantics as . /// The formatting string. /// The object to write into the format string. /// The object to write into the format string. /// The object to write into the format string. /// /// is null. /// The is closed. /// An I/O error occurs. /// The format specification in format is invalid.-or- The number indicating an argument to be formatted is less than zero, or larger than or equal to the number of provided objects to be formatted. /// 1 // Token: 0x06001835 RID: 6197 RVA: 0x0005CA34 File Offset: 0x0005AC34 public virtual void WriteLine(string format, object arg0, object arg1, object arg2) { this.Write(format, arg0, arg1, arg2); this.WriteLine(); } /// Stores the new line characters used for this TextWriter. // Token: 0x04000725 RID: 1829 protected char[] CoreNewLine; // Token: 0x04000726 RID: 1830 internal IFormatProvider internalFormatProvider; /// Provides a TextWriter with no backing store that can be written to, but not read from. /// 1 // Token: 0x04000727 RID: 1831 public static readonly TextWriter Null = new TextWriter.NullTextWriter(); // Token: 0x020001D7 RID: 471 private sealed class NullTextWriter : TextWriter { // Token: 0x1700043F RID: 1087 // (get) Token: 0x06001837 RID: 6199 RVA: 0x0005CA50 File Offset: 0x0005AC50 public override Encoding Encoding { get { return Encoding.Default; } } // Token: 0x06001838 RID: 6200 RVA: 0x0005CA58 File Offset: 0x0005AC58 public override void Write(string s) { } // Token: 0x06001839 RID: 6201 RVA: 0x0005CA5C File Offset: 0x0005AC5C public override void Write(char value) { } // Token: 0x0600183A RID: 6202 RVA: 0x0005CA60 File Offset: 0x0005AC60 public override void Write(char[] value, int index, int count) { } } } }