Topic Path: Symbol Reference > Classes > TIdDecoderMIMELineByLine Class > TIdDecoderMIMELineByLine Methods > Decode Method
ContentsIndexHome
PreviousUpNext
TIdDecoderMIMELineByLine.Decode Method

Implements line-oriented decoding for Base64-encoded values.

procedure Decode(
    const AIn: string; 
    const AStartPos: Integer = 1; 
    const ABytes: Integer = -1
); override;
Parameters 
Description 
AIn 
Base64-encoded values to be decoded.
 
AStartPos 
Initial position in the values to decoded. Default value is 1.
 
ABytes 
Number of bytes to decode from AIn. Default value is -1 and indicates all byte values. 

Decode is an overridden procedure that implements line-oriented decoding for Base64-encoded values. 

TIdDecoderMIMELineByLine maintains an internal buffer for decoding operations that use Base64-encoded values that are not a multiple of 4-bytes. In other words, the FillChar may not have been appended to the end of the encoded values. Decode ensure that any remaining values in the internal buffer are included before added new values specified in AIn. 

Decode determines if the number of bytes in the input values is a multiple of 4 (for the 4-byte to 3-byte decoding operation). When it is not a multiple of 4, the unused bytes by are retained in an internal buffer for use in subsequent calls to the Decode method. 

Use Clear to discard any remaining bytes prior to starting the decoding operation. 

Decode calls the inherited method to perform Base64 decoding for the values specified. 

Call FinishDecoding to ensure that unused bytes in the internal buffer are padded with one or more values from the FillChar property and decoded.

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