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!

MemoryStream.Seek

Sets the current position within the current stream to the specified value.

[Visual Basic]
Overrides Public Function Seek( _
   ByVal offset As Long, _
   ByVal loc As SeekOrigin _
) As Long
[C#]
public override long Seek(
   long offset,
   SeekOrigin loc
);
[C++]
public: override __int64 Seek(
   __int64 offset,
   SeekOrigin loc
);
[JScript]
public override function Seek(
   offset : long,
   loc : SeekOrigin
) : long;

Parameters

offset
The new position within the stream. This is relative to loc, and may be positive or negative, accordingly.
loc
A field of SeekOrigin, which acts as the seek reference point.

Return Value

The new position within the stream, calculated by combining the initial reference point and the offset.

Exceptions

Exception Type Condition
IOException Seeking is attempted before the beginning or more than one byte beyond the end of the stream.

Remarks

Positioning more than one byte beyond the length of the stream is not supported.

See Also

MemoryStream Class | MemoryStream Members | System.IO Namespace