class TextReader

in global :: System . IO

Represents a reader that can read a sequential series of characters.


public static TextReader Null

Provides a with no data to read from.

public int Read( char[] buffer, int index, int count )

Reads a specified maximum number of characters from the current reader and writes the data to a buffer, beginning at the specified index.

  • buffer When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
  • index The position in at which to begin writing.
  • count The maximum number of characters to read. If the end of the reader is reached before the specified number of characters is read into the buffer, the method returns.
  • Returns The number of characters that have been read. The number will be less than or equal to , depending on whether the data is available within the reader. This method returns 0 (zero) if it is called when no more characters are left to read.

public Task<int> ReadAsync( char[] buffer, int index, int count )

Reads a specified maximum number of characters from the current text reader asynchronously and writes the data to a buffer, beginning at the specified index.

  • buffer When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
  • index The position in at which to begin writing.
  • count The maximum number of characters to read. If the end of the text is reached before the specified number of characters is read into the buffer, the current method returns.
  • Returns A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the text has been reached.

public int ReadBlock( char[] buffer, int index, int count )

Reads a specified maximum number of characters from the current text reader and writes the data to a buffer, beginning at the specified index.

  • buffer When this method returns, this parameter contains the specified character array with the values between and ( + -1) replaced by the characters read from the current source.
  • index The position in at which to begin writing.
  • count The maximum number of characters to read.
  • Returns The number of characters that have been read. The number will be less than or equal to , depending on whether all input characters have been read.

public Task<int> ReadBlockAsync( char[] buffer, int index, int count )

Reads a specified maximum number of characters from the current text reader asynchronously and writes the data to a buffer, beginning at the specified index.

  • buffer When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
  • index The position in at which to begin writing.
  • count The maximum number of characters to read. If the end of the text is reached before the specified number of characters is read into the buffer, the current method returns.
  • Returns A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the text has been reached.

public static TextReader Synchronized( TextReader reader )

Creates a thread-safe wrapper around the specified .

  • reader The to synchronize.
  • Returns A thread-safe .

public bool Equals( object obj )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public object InitializeLifetimeService( )

😔 No documentation found.

public object GetLifetimeService( )

😔 No documentation found.

public ValueTask<int> ReadBlockAsync( Memory<char> buffer, CancellationToken cancellationToken = null )

😔 No documentation found.

public ValueTask<int> ReadAsync( Memory<char> buffer, CancellationToken cancellationToken = null )

😔 No documentation found.

public Task<string> ReadToEndAsync( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public ValueTask<string> ReadLineAsync( CancellationToken cancellationToken )

😔 No documentation found.

public Task<string> ReadLineAsync( )

😔 No documentation found.

public string ReadLine( )

😔 No documentation found.

public int ReadBlock( Span<char> buffer )

😔 No documentation found.

public string ReadToEnd( )

😔 No documentation found.

public int Read( Span<char> buffer )

😔 No documentation found.

public int Read( )

😔 No documentation found.

public int Peek( )

😔 No documentation found.

public void Dispose( )

😔 No documentation found.

public Task<string> ReadToEndAsync( CancellationToken cancellationToken )

😔 No documentation found.

public void Close( )

😔 No documentation found.