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

Resets the internal stream used to access the contents of the message part.

procedure FinishTempStream; override;

FinishTempStream is an overridden procedure that implements the interface specified in the TIdAttachment ancestor class. 

FinishTempStream is called when loading or receiving a message with in-memory 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. 

Use PrepareTempStream to ensure that the temporary stream used for processing the contents of the message part is set to its origin prior to reading values stored in the message part. 

FinishTempStream ensures that the temporary stream used for processing the contents of the message part is reset to its original stream position after reading values in the message part. 

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







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