MemoryStream: SeekPosition

SeekPosition

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



 Public Function SeekPosition(
	  ByVal Offset As Currency,
	  ByVal Loc As SeekOrigin ) As Currency

Parameters

Offset
[ByVal] Currency. The new position within the stream. This is relative to the Loc parameter, and can be positive or negative.
Loc
[ByVal] SeekOrigin. A value of type SeekOrigin, which acts as the seek reference point.

Return Values

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

Remarks

Seeking to any location beyond the length of the stream is supported.

Do not use the SeekPosition method to determine the new position in the stream if the MemoryStream was initialized with a non-zero offset. If you do, SeekPosition will return an inaccurate value. Instead, use the Position property to get the new position of the stream.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionOffset is greater than max 32-bit value.
ArgumentException There is an invalid SeekOrigin.
ObjectDisposedExceptionThe current stream instance is closed.

See Also

Project CorLib Overview

Class MemoryStream Overview