Class StreamReader
Represents a reader that can read a sequential series of characters.
public class StreamReader : TextReader
- Inheritance
-
objectMarshalByRefObjectTextReaderStreamReader
- Extension Methods
Properties
EndOfStream
Gets a value that indicates whether the current stream position is at the end of the stream.
public bool EndOfStream { get; }
Property Value
- bool
Methods
Dispose(bool)
Releases all resources.
protected override void Dispose(bool disposing)
Parameters
disposingboolDisposing
New(Stream)
Returns new instance of stream reader class.
public static StreamReader New(Stream stream)
Parameters
streamStreamSystem.IO.Stream object
Returns
New(Stream, Encoding)
Returns new instance of stream reader class.
public static StreamReader New(Stream stream, Encoding encoding)
Parameters
streamStreamSystem.IO.Stream object
encodingEncodingEncoding
Returns
New(StreamReader)
Returns new instance of stream reader class.
public static StreamReader New(StreamReader sr)
Parameters
srStreamReaderSystem stream reader object
Returns
New(string)
Returns new instance of stream reader class.
public static StreamReader New(string path)
Parameters
pathstringPath
Returns
Peek()
Returns the next available character but does not consume it.
public override int Peek()
Returns
- int
Read()
Reads the next character from the input stream and advances the character position by one character.
public override int Read()
Returns
- int
ReadLine()
Reads a line from the underlying string.
public override string ReadLine()
Returns
- string
ReadToEnd()
Reads the stream from the current position to the end of the stream.
public override string ReadToEnd()
Returns
- string