RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TZDecompressionStream.Seek Method

Resets the input stream, or moves the position forward.

Pascal
function Seek(offset: Longint; origin: Word): Longint; override;
C++
virtual __fastcall Longint Seek(Longint offset, Word origin);

A TZDecompressionStream is a read-only, unidirectional input stream. Write operations are not permitted, and will raise an exception of type ECompressionError. Seek operations can be used to move the stream position forward, but a Seek operation that attempts to move the position backwards will raise an ECompressionError exception, with the message string set to "Invalid Stream Operation." 

You can call the Seek method with an Offset of zero, and the Origin set to soFromBeginning. This has the effect of resetting the input stream, effectively rewinding the stream back to the beginning. 

Otherwise, the Offset parameter must be a positive Longint, and the Origin parameter must be either soFromCurrent, or soFromBeginning. This has the effect of moving the input stream position forward, decompressing data as it goes. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!