Internet Direct (Indy)
Home
PreviousUpNext
TIdMessageEncoderMIME.Encode@TIdStreamRandomAccess@TIdStream

Implements the Base64 encoding algorithm for the message part encoder.

Parameters 
Description 
ASrc 
Stream containing the message part to be encoded.
 
ADest 
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.

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.