NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Stream.Position

Determines the position within the current stream.

[Visual Basic]
MustOverride Public Property Position As Long
[C#]
public long Position {abstract get; abstract set;}
[C++]
public: __property virtual __int64 get_Position() = 0;public: __property virtual void set_Position(__int64) = 0;
[JScript]
public abstract function get Position() : long;
public abstract function set Position(long);

Property Value

The current position within the stream.

Exceptions

Exception Type Condition
IOException An I/O error occurs.
NotSupportedException The stream does not support seeking.

Remarks

This stream must support seeking to get or set the position. Use the CanSeek property to determine whether the stream supports seeking.

The position cannot be set more than one byte beyond the end of the stream. You can set the position to just beyond the last byte so you can append to the file. Opening a new file and then writing to it requires this.

The default get accessor invokes the Seek method. The default set accessor calls Seek and returns the result. Therefore, it is possible to override Seek so that the Position property provides the functionality described above.

See Also

Stream Class | Stream Members | System.IO Namespace