class TextWriter

in global :: System . IO

Represents a writer that can write a sequential series of characters. This class is abstract.


public Encoding Encoding { get; }

When overridden in a derived class, returns the character encoding in which the output is written.

  • Returns The character encoding in which the output is written.

public IFormatProvider FormatProvider { get; }

Gets an object that controls formatting.

  • Returns An object for a specific culture, or the formatting of the current culture if no other culture is specified.

public string NewLine { get; set; }

Gets or sets the line terminator string used by the current .

  • Returns The line terminator string for the current .

public static TextWriter Null

Provides a with no backing store that can be written to, but not read from.

public static TextWriter Synchronized( TextWriter writer )

Creates a thread-safe wrapper around the specified .

  • writer The to synchronize.
  • Returns A thread-safe wrapper.

public void Write( bool value )

Writes the text representation of a value to the text stream.

  • value The value to write.

public void Write( char value )

Writes a character to the text stream.

  • value The character to write to the text stream.

public void Write( char[] buffer )

Writes a character array to the text stream.

  • buffer The character array to write to the text stream.

public void Write( char[] buffer, int index, int count )

Writes a subarray of characters to the text stream.

  • buffer The character array to write data from.
  • index The character position in the buffer at which to start retrieving data.
  • count The number of characters to write.

public void Write( decimal value )

Writes the text representation of a decimal value to the text stream.

  • value The decimal value to write.

public void Write( double value )

Writes the text representation of an 8-byte floating-point value to the text stream.

  • value The 8-byte floating-point value to write.

public void Write( int value )

Writes the text representation of a 4-byte signed integer to the text stream.

  • value The 4-byte signed integer to write.

public void Write( long value )

Writes the text representation of an 8-byte signed integer to the text stream.

  • value The 8-byte signed integer to write.

public void Write( object value )

Writes the text representation of an object to the text stream by calling the method on that object.

  • value The object to write.

public void Write( float value )

Writes the text representation of a 4-byte floating-point value to the text stream.

  • value The 4-byte floating-point value to write.

public void Write( string value )

Writes a string to the text stream.

  • value The string to write.

public void Write( string format, object arg0 )

Writes a formatted string to the text stream, using the same semantics as the method.

  • format A composite format string.
  • arg0 The object to format and write.

public void Write( string format, object arg0, object arg1 )

Writes a formatted string to the text stream using the same semantics as the method.

  • format A composite format string.
  • arg0 The first object to format and write.
  • arg1 The second object to format and write.

public void Write( string format, object arg0, object arg1, object arg2 )

Writes a formatted string to the text stream, using the same semantics as the method.

  • format A composite format string.
  • arg0 The first object to format and write.
  • arg1 The second object to format and write.
  • arg2 The third object to format and write.

public void Write( string format, object[] arg )

Writes a formatted string to the text stream, using the same semantics as the method.

  • format A composite format string.
  • arg An object array that contains zero or more objects to format and write.

public void Write( uint value )

Writes the text representation of a 4-byte unsigned integer to the text stream.

  • value The 4-byte unsigned integer to write.

public void Write( ulong value )

Writes the text representation of an 8-byte unsigned integer to the text stream.

  • value The 8-byte unsigned integer to write.

public Task WriteAsync( char value )

Writes a character to the text stream asynchronously.

  • value The character to write to the text stream.
  • Returns A task that represents the asynchronous write operation.

public Task WriteAsync( char[] buffer )

Writes a character array to the text stream asynchronously.

  • buffer The character array to write to the text stream. If is , nothing is written.
  • Returns A task that represents the asynchronous write operation.

public Task WriteAsync( char[] buffer, int index, int count )

Writes a subarray of characters to the text stream asynchronously.

  • buffer The character array to write data from.
  • index The character position in the buffer at which to start retrieving data.
  • count The number of characters to write.
  • Returns A task that represents the asynchronous write operation.

public Task WriteAsync( string value )

Writes a string to the text stream asynchronously.

  • value The string to write. If is , nothing is written to the text stream.
  • Returns A task that represents the asynchronous write operation.

public void WriteLine( bool value )

Writes the text representation of a value to the text stream, followed by a line terminator.

  • value The value to write.

public void WriteLine( char value )

Writes a character to the text stream, followed by a line terminator.

  • value The character to write to the text stream.

public void WriteLine( char[] buffer )

Writes an array of characters to the text stream, followed by a line terminator.

  • buffer The character array from which data is read.

public void WriteLine( char[] buffer, int index, int count )

Writes a subarray of characters to the text stream, followed by a line terminator.

  • buffer The character array from which data is read.
  • index The character position in at which to start reading data.
  • count The maximum number of characters to write.

public void WriteLine( decimal value )

Writes the text representation of a decimal value to the text stream, followed by a line terminator.

  • value The decimal value to write.

public void WriteLine( double value )

Writes the text representation of a 8-byte floating-point value to the text stream, followed by a line terminator.

  • value The 8-byte floating-point value to write.

public void WriteLine( int value )

Writes the text representation of a 4-byte signed integer to the text stream, followed by a line terminator.

  • value The 4-byte signed integer to write.

public void WriteLine( long value )

Writes the text representation of an 8-byte signed integer to the text stream, followed by a line terminator.

  • value The 8-byte signed integer to write.

public void WriteLine( object value )

Writes the text representation of an object to the text stream, by calling the method on that object, followed by a line terminator.

  • value The object to write. If is , only the line terminator is written.

public void WriteLine( float value )

Writes the text representation of a 4-byte floating-point value to the text stream, followed by a line terminator.

  • value The 4-byte floating-point value to write.

public void WriteLine( string value )

Writes a string to the text stream, followed by a line terminator.

  • value The string to write. If is , only the line terminator is written.

public void WriteLine( string format, object arg0 )

Writes a formatted string and a new line to the text stream, using the same semantics as the method.

  • format A composite format string.
  • arg0 The object to format and write.

public void WriteLine( string format, object arg0, object arg1 )

Writes a formatted string and a new line to the text stream, using the same semantics as the method.

  • format A composite format string.
  • arg0 The first object to format and write.
  • arg1 The second object to format and write.

public void WriteLine( string format, object arg0, object arg1, object arg2 )

Writes out a formatted string and a new line to the text stream, using the same semantics as .

  • format A composite format string.
  • arg0 The first object to format and write.
  • arg1 The second object to format and write.
  • arg2 The third object to format and write.

public void WriteLine( string format, object[] arg )

Writes out a formatted string and a new line to the text stream, using the same semantics as .

  • format A composite format string.
  • arg An object array that contains zero or more objects to format and write.

public void WriteLine( uint value )

Writes the text representation of a 4-byte unsigned integer to the text stream, followed by a line terminator.

  • value The 4-byte unsigned integer to write.

public void WriteLine( ulong value )

Writes the text representation of an 8-byte unsigned integer to the text stream, followed by a line terminator.

  • value The 8-byte unsigned integer to write.

public Task WriteLineAsync( char value )

Asynchronously writes a character to the text stream, followed by a line terminator.

  • value The character to write to the text stream.
  • Returns A task that represents the asynchronous write operation.

public Task WriteLineAsync( char[] buffer )

Asynchronously writes an array of characters to the text stream, followed by a line terminator.

  • buffer The character array to write to the text stream. If the character array is , only the line terminator is written.
  • Returns A task that represents the asynchronous write operation.

public Task WriteLineAsync( char[] buffer, int index, int count )

Asynchronously writes a subarray of characters to the text stream, followed by a line terminator.

  • buffer The character array to write data from.
  • index The character position in the buffer at which to start retrieving data.
  • count The number of characters to write.
  • Returns A task that represents the asynchronous write operation.

public Task WriteLineAsync( string value )

Asynchronously writes a string to the text stream, followed by a line terminator.

  • value The string to write. If the value is , only a line terminator is written.
  • Returns A task that represents the asynchronous write operation.

public Type GetType( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public object GetLifetimeService( )

😔 No documentation found.

public static TextWriter CreateBroadcasting( TextWriter[] writers )

😔 No documentation found.

public void Dispose( )

😔 No documentation found.

public Task FlushAsync( CancellationToken cancellationToken )

😔 No documentation found.

public Task FlushAsync( )

😔 No documentation found.

public Task WriteLineAsync( )

😔 No documentation found.

public Task WriteLineAsync( ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = null )

😔 No documentation found.

public object InitializeLifetimeService( )

😔 No documentation found.

public void Flush( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public void Close( )

😔 No documentation found.

public void Write( ReadOnlySpan<char> buffer )

😔 No documentation found.

public Task WriteAsync( StringBuilder value, CancellationToken cancellationToken = null )

😔 No documentation found.

public void Write( StringBuilder value )

😔 No documentation found.

public void Write( string format, ReadOnlySpan<object> arg )

😔 No documentation found.

public void WriteLine( string format, ReadOnlySpan<object> arg )

😔 No documentation found.

public void WriteLine( )

😔 No documentation found.

public void WriteLine( StringBuilder value )

😔 No documentation found.

public void WriteLine( ReadOnlySpan<char> buffer )

😔 No documentation found.

public ValueTask DisposeAsync( )

😔 No documentation found.

public Task WriteLineAsync( StringBuilder value, CancellationToken cancellationToken = null )

😔 No documentation found.

public Task WriteAsync( ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = null )

😔 No documentation found.