BufferedStream.Position 屬性

定義

取得目前資料流中的位置。Gets the position within the current stream.

public:
 virtual property long Position { long get(); void set(long value); };
public override long Position { get; set; }
member this.Position : int64 with get, set
Public Overrides Property Position As Long

屬性值

目前資料流中的位置。The position within the current stream.

例外狀況

傳遞至 Seek(Int64, SeekOrigin) 的值為負數。The value passed to Seek(Int64, SeekOrigin) is negative.

發生 I/O 錯誤,例如資料流已經關閉。An I/O error occurs, such as the stream being closed.

資料流不支援搜尋。The stream does not support seeking.

關閉資料流後呼叫了方法。Methods were called after the stream was closed.

備註

get 存取子會叫用 Seek 以取得基礎資料流程中的目前位置,然後根據緩衝區中的目前位置來調整此值。The get accessor invokes Seek to obtain the current position within the underlying stream and then adjusts this value according to the current position within the buffer.

set 存取子會將先前寫入緩衝區的任何資料複製到基礎資料流程,然後再叫用 SeekThe set accessor copies any data previously written to the buffer to the underlying stream, and then invokes Seek.

支援搜尋超出資料流程長度的任何位置。Seeking to any location beyond the length of the stream is supported.

適用於

另請參閱