Share via


StreamReader Constructor (Stream)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Initializes a new instance of the StreamReader class for the specified stream.

Namespace:  System.IO
Assembly:  System.IO (in System.IO.dll)

Syntax

'Declaration
Public Sub New ( _
    stream As Stream _
)
public StreamReader(
    Stream stream
)
public:
StreamReader(
    Stream^ stream
)
new : 
        stream:Stream -> StreamReader
public function StreamReader(
    stream : Stream
)

Parameters

Remarks

This constructor initializes the encoding to UTF8Encoding, the BaseStream property using the stream parameter, and the internal buffer size to 1024 bytes.

The StreamReader object calls Dispose()()()() on the provided Stream object when StreamReader..::..Dispose is called.

.NET Framework Security

See Also

Reference

StreamReader Class

StreamReader Overload

System.IO Namespace