UnmanagedMemoryStream.Seek Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Sets the current position of the current stream to the given value.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overrides Function Seek ( _
    offset As Long, _
    loc As SeekOrigin _
) As Long
public override long Seek(
    long offset,
    SeekOrigin loc
)

Parameters

  • offset
    Type: System.Int64
    The point relative to origin to begin seeking from.
  • loc
    Type: System.IO.SeekOrigin
    Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type SeekOrigin.

Return Value

Type: System.Int64
The new position in the stream.

Exceptions

Exception Condition
IOException

An attempt was made to seek before the beginning of the stream.

ArgumentOutOfRangeException

The offset value is larger than the maximum size of the stream.

ArgumentException

loc is invalid.

ObjectDisposedException

The stream is closed.

Remarks

For more information about seeking, see Seek.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.