Indy 9 | Content | Index | Reference

TIdMessageEncoderMIME
Hierarchy, Properties, Methods, Events, See Also, Unit: IdMessageCoderMIME
Implements an encoder for RFC-822 compliant MIME message parts.

    TIdMessageEncoderMIME = class(TIdMessageEncoder)

Unit
IdMessageCoderMIME
Description
TIdMessageEncoderMIME is a TIdMessageEncoder descendant that implements an encoder for RFC-822 compliant MIME message parts that can be represented using MIME-encoded data. TIdMessageEncoderMIME reimplements the Encode method to provide support for the Base64 encoding agorithm using TIdEncoderMIME.

TIdMessageEncoderMIME.Encode
TIdMessageEncoderMIME, See Also
Implements the Base64 encoding algorithm for the message part encoder.

    procedure Encode(ASrc: TStream; ADest: TStream); override;

Parameters
ASrc: TStream
Stream containing the message part to be encoded.
ADest: TStream
Stream to receive the encoded data.
Description
Encode is an overridden procedure in TIdMessageEncoderMIME that implements the Base64 encoding algorithm for the RFC message part encoder.

ASrc is a TStream descendant that contains the un-encoded data for the message part. Encode positions the stream to its origin before the encoding algorithm is used to convert the data in ASrc.

ADest is a TStream descendant that will be used to receive the encoded data for the message part.

Encode uses an instance of TIdEncoderMIME to perform the physical encoding of data using the Base64 algorithm. Encode calls TIdEncoderMIME.Encode using 57 characters from ASrc per call. 57 characters is the maximum number of un-encoded data bytes that can be represented in the 72 character Base64-encoded line after applying the 3-byte to 4-byte encoding algorithm. All encoded data is written to the TStream descendant ADest.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.