Topic Path: Pending > TIdMessageEncoderMIME.Encode@TIdStreamRandomAccess@TIdStream

Implements the Base64 encoding algorithm for the message part encoder.

Stream containing the message part to be encoded.
Stream to receive the encoded data. 

Encode is an overridden procedure in TIdMessageEncoderMIME that implements the Base64 encoding algorithm for the RFC message part encoder. 

ASrc is a TIdStreamRandomAccess 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 TIdStream 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.

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