System.Classes.TCustomMemoryStream.Seek
Delphi
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
C++
virtual __int64 __fastcall Seek(const __int64 Offset, TSeekOrigin Origin)/* overload */;
inline System::LongInt __fastcall Seek(System::LongInt Offset, System::Word Origin){ return TStream::Seek(Offset, Origin); }
inline __int64 __fastcall Seek(const __int64 Offset, System::Word Origin){ return TStream::Seek(Offset, Origin); }
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Classes.pas System.Classes.hpp |
System.Classes | TCustomMemoryStream |
Description
Moves the current position of the stream by Offset
bytes, relative to the origin specified by Origin
.
Use Seek to move the current position within the memory stream by the indicated offset. Seek allows an application to read from or write to a particular location within the Memory associated with the memory stream.
If Offset
is a negative number, the seeking is backward from the specified origin. The following table shows the different values of Origin
and their meanings for seeking:
Value | Meaning |
---|---|
| |
| |
|
Seek returns the new value of the Position property.
Note: Seek does no error checking on the value provided for
Offset
. Do not call Seek with an offset that would move the current position less than 0 (before the start of Memory) or greater thanSize
(beyond the end of the memory buffer).
See Also
- System.Classes.TSeekOrigin
- System.Classes.TCustomMemoryStream.Memory
- System.Classes.TStream.Position
- System.Classes.TCustomMemoryStream.Read
- System.Classes.TStream.Size
- System.Classes.TStream.Write
- System.Classes
- System.Classes
- System.Classes