StreamReader.BaseStream StreamReader.BaseStream StreamReader.BaseStream StreamReader.BaseStream Property

定義

傳回基礎資料流。Returns the underlying stream.

public:
 virtual property System::IO::Stream ^ BaseStream { System::IO::Stream ^ get(); };
public virtual System.IO.Stream BaseStream { get; }
member this.BaseStream : System.IO.Stream
Public Overridable ReadOnly Property BaseStream As Stream

屬性值

基礎資料流。The underlying stream.

備註

您可以使用這個屬性來存取基礎資料流程。You use this property to access the underlying stream. StreamReader您呼叫其中一個Read方法時,類別會緩衝基礎資料流程的輸入。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. 若要重設內部緩衝區, 請DiscardBufferedData呼叫方法; 不過, 這個方法會降低效能, 而且只有在絕對必要時才應呼叫。To reset the internal buffer, call the DiscardBufferedData method; however, this method slows performance and should be called only when absolutely necessary. 具有參數的函式可以在您第一StreamReader次從物件讀取時變更編碼。 detectEncodingFromByteOrderMarks StreamReaderThe StreamReader constructors that have the detectEncodingFromByteOrderMarks parameter can change the encoding the first time you read from the StreamReader object.

如需一般 i/o 工作的清單, 請參閱一般 i/o工作。For a list of common I/O tasks, see Common I/O Tasks.

適用於

另請參閱