Internet Direct (Indy)
Home
PreviousUpNext
TIdAttachment.OpenLoadStream Method

Specifies the method used to open and initialize the internal stream needed for loading an attachment before transmission.

Pascal
function OpenLoadStream: TIdStream; virtual; abstract;

TStream - Stream used to access the contents of the message part.

OpenLoadStream is an abstract virtual TStream function that specifies the method used to open and initialize the internal stream needed for loading an attachment before transmission. 

OpenLoadStream is used to ensure that the internal stream for accessing data in the message part is created, opened, and repositioned prior to reading values during message transmission. 

OpenLoadStream must be overridden in an ancestor class to properly create, open, or position the internal stream used for loading the contents of an attachment prior to transmission. 

During transmission, values in the internal stream are encoded based on the properties specified in the message or message part using methods in TIdMessageClient like SendHeader and SendBody. 

CloseLoadStream is used to ensure that the internal stream for accessing data in the message part is reset when all values have been read during transmission. 

If the internal stream is created in OpenLoadStream, it should be freed in CloseLoadStream. An existing stream should be repositioned to its initial position prior to reading values for the message part.

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.