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

Implement the common decoding mechanism for both UUE and XXE decoders.

procedure Decode(
    const AIn: string; 
    const AStartPos: Integer = 1; 
    const ABytes: Integer = -1
); override;
Parameters 
Description 
AIn 
Encoded values to be decoded in the method.
 
AStartPos 
Initial byte value to be used in decoding values. Default is 1.
 
ABytes 
Number of bytes to decode in the method. Default is -1. 

Decode is an overridden procedure used to implement the common decoding mechanism for both UUE and XXE decoders. Decode calls the inherited Decode method to convert the 4-byte encoding to its 3-byte unencoded representation. 

When ABytes contains -1, all encoded values in AIn are affected by the decoding operation. Decode reads the encoded length of the encoded values from the first byte in AIn, and uses the decoder table to convert it to an integer value. 

When Abytes contains any value othe than -1, it is assumed that the length has already been read from the encoded data stream. The inherited methgod id called using AStartPos and ABytes to perform the 4-byte to 3-byte decoding operation. 

The table-based alphabet for UUE or XXE decoding is not defined in TIdDecoder00E. Use a descendant class, like TIdDecoderUUE or TIdDecoderXXE, where the decoder table is implemented.

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