Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Seek

abstract virtual func Seek(position: long) -> Result<long, StreamError>

Declaring type: SeekableStream
Module: System.IO
Assembly: System.Runtime.dll
Source file: SeekableStream.rvn

Defined by SeekableStream.Seek · Required implementation (no default).

Interface implementation: Required implementation (no default).

Sets the absolute byte position without changing file contents.

Parameters

Name Type Description
position Int64 Nonnegative absolute byte offset. FileInputStream permits positions beyond EOF.

Return value

Result<Int64, StreamError>

The resulting position or StreamError.

Remarks

Closed is checked first. Negative positions return InvalidRange without moving the cursor. Reading beyond EOF returns zero. Seeking does not reset a separate text reader's state; close a leave-open reader before independently repositioning and constructing a new reader.