StreamReader
StreamReader is a class in the .NET framework and .NET Core under the System.IO namespace. It provides a convenient way to read characters from a byte stream by decoding bytes into text using a specified character encoding. StreamReader buffers input to improve performance and is commonly used to read text from files, network streams, or memory streams.
Constructing a StreamReader can be done from a Stream or from a file path. Overloads allow specifying
Key reading operations include Read, Read(char[], int, int), ReadLine, and ReadToEnd, which provide character-by-character, block, line-based,
StreamReader is widely used in file I/O and text-processing scenarios, and is compatible with various stream