Tdecompressionstream.Seek function
Move stream position to a certain location in the stream.
Declaration
function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64
; overrideArguments
Offset | Offset to apply to the position in the stream. |
Origin | Origin from where
|
Function result
New position in the stream.
Description
Seek overrides the standard
Seek implementation.
There are a few differences between the implementation of
Seek
in Free Pascal compared to Delphi:
- In Free Pascal, you can perform any seek. In case of a forward seek,
the Free Pascal implementation will read some bytes until the desired
position is reached, in case of a backward seek it will seek the
source stream backwards to the position it had at the creation time
of the
TDecompressionStreamand then again read some bytes until the desired position has been reached. - In Free Pascal, a seek with soFromBeginning will reset the source
stream to the position it had when the
TDecompressionStreamwas created. In Delphi, the source stream is reset to position 0. This means that at creation time the source stream must always be at the start of the zstream, you cannot useTDecompressionStream.Seekto reset the source stream to the begin of the file.
Errors
An EDecompressionError exception is raised if the stream does not allow the requested seek operation.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
