TYPE
StreamReader
Decodes bytes into text; leaveOpen controls stream ownership.
Formal Syntax & Structure
csharp syntaxcsharp
new StreamReader(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen)Working Example
Example Snippetcsharp
// Documentary fragment; see lesson for context and imports.using var reader = new StreamReader(stream, Encoding.UTF8, false, 128, true);