class StreamReader
Implements a that reads characters from a byte stream in a particular encoding.
public Stream BaseStream { get; }
Returns the underlying stream.
- Returns The underlying stream.
public Encoding CurrentEncoding { get; }
Gets the current character encoding that the current object is using.
- Returns The current character encoding used by the current reader. The value can be different after the first call to any method of , since encoding autodetection is not done until the first call to a method.
public bool EndOfStream { get; }
Gets a value that indicates whether the current stream position is at the end of the stream.
- Returns if the current stream position is at the end of the stream; otherwise .
public static StreamReader Null
A object around an empty stream.
public int Read( char[] buffer, int index, int count )
Reads a specified maximum of characters from the current stream into a buffer, beginning at the specified index.
bufferWhen this method returns, contains the specified character array with the values between and (index + count - 1) replaced by the characters read from the current source.indexThe index of at which to begin writing.countThe maximum number of characters to read.- Returns The number of characters that have been read, or 0 if at the end of the stream and no data was read. The number will be less than or equal to the parameter, depending on whether the data is available within the stream.
public Task<int> ReadAsync( char[] buffer, int index, int count )
Reads a specified maximum number of characters from the current stream asynchronously and writes the data to a buffer, beginning at the specified index.
bufferWhen this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.indexThe position in at which to begin writing.countThe maximum number of characters to read. If the end of the stream is reached before the specified number of characters is written 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 characters read into the buffer. The result value can be less than the number of characters requested if the number of characters currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
public int ReadBlock( char[] buffer, int index, int count )
Reads a specified maximum number of characters from the current stream and writes the data to a buffer, beginning at the specified index.
bufferWhen this method returns, contains the specified character array with the values between and (index + count - 1) replaced by the characters read from the current source.indexThe position in at which to begin writing.countThe 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 stream asynchronously and writes the data to a buffer, beginning at the specified index.
bufferWhen this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.indexThe position in at which to begin writing.countThe maximum number of characters to read. If the end of the stream is reached before the specified number of characters is written into the buffer, the method returns.- Returns A task that represents the asynchronous read operation. The value of the parameter contains the total number of characters read into the buffer. The result value can be less than the number of characters requested if the number of characters currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
public int Read( )
😔 No documentation found.
public int Read( Span<char> buffer )
😔 No documentation found.
public string ReadToEnd( )
😔 No documentation found.
public ValueTask<int> ReadBlockAsync( Memory<char> buffer, CancellationToken cancellationToken = null )
😔 No documentation found.
public string ReadLine( )
😔 No documentation found.
public Task<string> ReadLineAsync( )
😔 No documentation found.
public ValueTask<string> ReadLineAsync( CancellationToken cancellationToken )
😔 No documentation found.
public Task<string> ReadToEndAsync( )
😔 No documentation found.
public Task<string> ReadToEndAsync( CancellationToken cancellationToken )
😔 No documentation found.
public ValueTask<int> ReadAsync( Memory<char> buffer, CancellationToken cancellationToken = null )
😔 No documentation found.
public int Peek( )
😔 No documentation found.
public int ReadBlock( Span<char> buffer )
😔 No documentation found.