Internet Direct (Indy) Version 9.0.2 Beta
TIdEncoderQuotedPrintable.Encode
Encodes values in a stream using the Quoted-Printable encoding scheme.

function Encode(ASrcStream: TStream; const ABytes: integer): string; override;
Parameters
ASrcStream: TStream
Stream containing values to be encoded.

const ABytes: integer = MaxInt
Number of Bytes in the input Stream to be encoded.

Returns
String - Quoted-Printable representation of values in the input stream.

Description
Encode is an overridden String function in TIdEncoderQuotedPrintable that implements the encoding algorithm for the Quoted-Printable encoding scheme as described in RFC 2045.

ASrcStream is a TStream descendant that contains the un-encoded values to be used in the encoding operation. When ASrcStream has a size of 0, no operation is performed by the Encode method.

ABytes is the number of Bytes in ASrcStream to be affected by the Encode method. If ABytes is smaller than ASrcStream.Size, only ABytes characters in the stream will be used for the encoding operation.

Encode uses an 8K buffer to read values from ASrcStream for the encoding algorithm. Note: Encode does not reset the position of ASrcStream before or after encoding operations.

Use TIdDecoderPrintable.DecodeToStream to convert the return value from Encode to their un-encoded state.