[Overview][Types][Classes] Reference for unit 'zstream' (#fcl)

TDecompressionStream.Seek

Move stream position to a certain location in the stream.

Declaration

Source position: zstream.pp line 88

public function TDecompressionStream.Seek(

  Offset: LongInt;

  Origin: Word

):LongInt; override;

Arguments

Offset

  

Offset to apply to the position in the stream

Origin

  

Origin from where Offsetshould be counted.

Function result

New position in the stream

Description

Seekoverrides the standard Seekimplementation. Normally, pipe streams stderr are not seekable. The TDecompressionStreamstream tries to provide seek capabilities for the following limited number of cases:

Origin=soFromBeginning
If Offsetis larger than the current position, then the remaining bytes are skipped by reading them from the stream and discarding them.
Origin=soFromCurrent
If Offsetis zero, the current position is returned. If it is positive, then Offsetbytes are skipped by reading them from the stream and discarding them, if the stream is of type iosInput.

All other cases will result in a EPipeSeekexception.

Errors

An EDecompressionErrorexception is raised if the stream does not allow the requested seek operation.

See also

Read

  

Read data from the compressed stream