Indy 9 | Content | Index | Reference

TIdDecoderUUEBase
Hierarchy, Properties, Methods, See Also, Unit: IdCoderUUE
Implements a decoder for data encoded using the UUEncode algorithm.

    TIdDecoderUUEBase = class(TIdDecoder4to3)

Unit
IdCoderUUE
Description
TIdDecoderUUEBase is a TIdDecoder4to3 descendant that implements a decoder for data encoded using the UUEncode algorithm. TIdDecoderUUEBase provides facilities for decoding the 7-bit US-ASCII representation of encoded data into it's original binary format.

TIdDecoderUUEBase uses the 4-byte to 3-byte decoding algorithm defined in TIdDecoder4to3. TIdDecoderUUEBase handles the UUEncode body line format, which consists of the encoded length followed by the encoded data.

TIdDecoderUUEBase is used by other Indy coder classes, such as TIdMessageDecoderUUE, that handle UUEncode message streams in RFC 822-compliant mail messages.

TIdDecoderUUEBase.DecodeToStream
TIdDecoderUUEBase, See Also
Converts a UUEncoded body line to it's original binary format.

    procedure DecodeToStream(AIn: string; ADest: TStream); override;

Parameters
AIn: string
Values to decoded.
ADest: TStream
Destination for decoded values.
Description
DecodeToStream is an overridden Procedure in TIdDecoderUUEBase that re-implements the inherited method to provide support for reading the UUEncode body line format, as well as the specifics of the UUDecode algorithm.

AIn contains the UUEncoded input values that will be restored to their original binary format.

ADest is a TStream descendant that will receive the results of the decoding algorithm.

When the length of AIn is 0, DecodeToStream does not attempt to perform the decoding algorithm. DecodeToStream reads the first byte in AIn to determine the length of the UUencoded data using the ordinal position of the value in the UUEncode alphabet.

The remainder of AIn is the UUEncoded data that will be restored to its original binary representation. When the length of the remaining portion of AIn is not a multiple of 3, AIn is padded with FillChar to the desired length.

Finally, DecodeToStream calls the inherited DecodeToStream method to perform conversion of the UUEncoded data to its binary representation.

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