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.

适用于

另请参阅