Determines the current position within the current stream.
[Visual Basic] Overridable Public Property Position As Long [C#] public long Position {override get; override set;} [C++] public: __property virtual __int64 get_Position(); public: __property virtual void set_Position(__int64); [JScript] public function get Position() : long; public function set Position(long);
The current position within the current stream.
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | value is negative. |
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support seeking. |
EndOfStreamException | Seeking was attempted beyond the length of a stream that does not support this. |
The default implementation of 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.
The default implementation of the set accessor copies any data previously written to the buffer to the underlying stream, and then invokes Seek.
Although some streams may allow the position to be set beyond the length of the stream, others may throw an exception.
BufferedStream Class | BufferedStream Members | System.IO Namespace | CanSeek