Topic Path: Symbol Reference > Classes > TIdAttachment Class > TIdAttachment Methods > FinishTempStream Method
TIdAttachment.FinishTempStream Method

Resets the internal stream used to access the message part.

procedure FinishTempStream; virtual; abstract;

FinishTempStream is an abstract virtual procedure tha specifies the method used to reset the internal stream for accessing the contents of the message part. 

FinishTempStream is called when loading or receiving a message with attachments. When a TIdMessage instance is received and processed using TIdMessageClient, or a descendant class, the overridden PrepareTempStream and FinishTempStream methods for the attachment are called. These methods apply to both receiving a message from a remote mail server or accessing a message from a local mail store. Essentially, loading a message and receiving a message are the same - differing only in the type of stream used to read the message contents. 

FinishTempStream ensures that the temporary stream used for processing the contents of the message part is freed or repositioned after reading values in the message part. 

Use PrepareTempStream to ensure that the temporary stream used for processing the contents of the message part is allocated or positioned prior to reading values stored in the message part. 

The ProcessMessage, ReceiveHeader, and ReceiveBody methods in TIdMessageClient rely on the overridden methods. 

FinishTempStream must be overridden in a descendant class, like TIdAttachmentFile or TIdAttachmentMemory, to implement freeing or repositioning the stream as required for the message part.







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