Sets the position within the current buffered stream.
[Visual Basic] Overrides Public Function Seek( _ ByVal offset As Long, _ ByVal origin As SeekOrigin _ ) As Long [C#] public override long Seek( long offset, SeekOrigin origin ); [C++] public: override __int64 Seek( __int64 offset, SeekOrigin origin ); [JScript] public override function Seek( offset : long, origin : SeekOrigin ) : long;
The new position within the current buffered stream.
Exception Type | Condition |
---|---|
IOException | The stream is not open or is null. |
NotSupportedException | The stream does not support seeking. |
EndOfStreamException | Seeking was attempted beyond the length of a stream that does not support this. |
If offset is negative, the new position will precede the position specified by origin by the number of bytes specified by offset. If offset is zero, the new position will be the position specified by origin. If offset is positive, the new position will follow the position specified by origin by the number of bytes specified by offset.
Note that some streams may support positioning beyond the length of the stream; others may throw an exception.
BufferedStream Class | BufferedStream Members | System.IO Namespace