When overridden in a derived class, sets the position within the current stream.

Namespace: Contracts
Assembly: Contracts (in Contracts.dll)

Public Overrides Function Seek( _ 
ByVal offset As Long, _ 
ByVal origin As SeekOrigin
) As Long
This language is not supported or no code example is available.
public override long Seek( 
long offset
SeekOrigin origin 
)
This language is not supported or no code example is available.
public:  
long Seek( 
long offset
SeekOrigin origin 
)
This language is not supported or no code example is available.
public function Seek( 
offset : long
origin : SeekOrigin 
) : long;
This language is not supported or no code example is available.

Parameters

offset
Type: long

A byte offset relative to the origin parameter.

origin
Type: SeekOrigin

A value of type SeekOrigin indicating the reference point used to obtain the new position.

Return Value

Type: long

The new position within the current stream.

Exception type Condition

IOException

An I/O error occurs.

ObjectDisposedException

Methods were called after the stream was closed.

NotSupportedException

The stream does not support seeking, such as if the stream is constructed from a pipe or console output.

.NET Framework

Supported in: 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1