Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StreamReader.BaseStream Property

Updated: December 2010

When it is called by trusted applications, returns the underlying stream.

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

public virtual Stream BaseStream { get; }

Property Value

Type: System.IO.Stream
The underlying stream.

You use this property to access the underlying stream. The StreamReader class buffers input from the underlying stream when you call one of the Read methods. If you manipulate the position of the underlying stream after reading data into the buffer, the position of the underlying stream might not match the position of the internal buffer. To reset the internal buffer, call the DiscardBufferedData method; however, this method slows performance and should be called only when absolutely necessary. The StreamReader constructors that have the detectEncodingFromByteOrderMarks parameter can change the encoding the first time you read from the StreamReader object.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Date

History

Reason

December 2010

Added information about calling DiscardBufferedData.

Information enhancement.

Community Additions

Show:
© 2014 Microsoft