Topic Path: Symbol Reference > Classes > TIdCompressionIntercept Class > TIdCompressionIntercept Methods > Send Method
ContentsIndexHome
PreviousUpNext
TIdCompressionIntercept.Send Method

Compresses stream data for the intercept using ZLib.

procedure Send(
    var VBuffer: TIdBytes
); override;
Parameters 
Description 
ABuffer 
Stream to use for input and output values for the operation. 

Send is an overridden procedure in TIdCompressionIntercept that implements ZLib compression of stream data received in ABuffer. When CompressionLevel is 0 (zero), the compression intercept is dormant and no compression is performed for values in ABuffer. 

Send initializes the internal ZLib compression and decompression records when they have been assigned in the object instance. Send ensures that the internal Send buffer is large enough to hold the stream data in ABuffer. Send reads data from the internal send buffer using a 2,048 byte block that expands by 1024 bytes on successive reads until the end of the ZLib stream is reached. 

If a stream, data, or memory error occurs while compressing the contents of the send buffer, a EIdCompressionError exception will be raised with the message RSZLCompressionError

On successful completion of send buffer compression, ABuffer is resized and the compressed data is returned to the stream.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.