Mono Class Library: System.IO.Stream Overview | MembersSystem.IO.Stream.Seek Method |
Changes the position within the current stream by the given offset, which is relative to the stated origin. [Edit]
|
- offset
- A long that specifies the byte offset relative to origin. [Edit]
- origin
- A System.IO.SeekOrigin value indicating the reference point used to obtain the new position. [Edit]
A long that specifies the new position within the current stream. [Edit]
Type Reason NotSupportedException The stream does not support seeking, such as if the stream is constructed from a pipe or console output. [Edit] ObjectDisposedException The stream is closed. [Edit] System.IO.IOException An I/O error has occurred. [Edit]
Note: Use the Stream.CanSeek property to determine whether the current instance supports seeking.Operation
If offset is negative, the new position is required to precede the position specified by origin by the number of bytes specified by offset. If offset is zero, the new position is required to be the position specified by origin. If offset is positive, the new position is required to follow the position specified by origin by the number of bytes specified by offset.Note to Inheritors
Classes derived from System.IO.Stream that support seeking are required to override this method.
[Edit]
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0