Internet Direct (Indy) Version 9.0.1 Beta
TIdDecoder4to3.DecodeToStream
Implements the TIdDecoder4to3 decoding algorithm for decoding String values to a Stream.

procedure DecodeToStream(AIn: string; ADest: TStream); override;
Parameters
AIn: string
Value to be decoded.

ADest: TStream
Stream that is the destination for the decoded value.

Description
DecodeToStream is an overridden procedure in TIdDecoder4to3 that implements decoding the String value in AIn to the TStream destination in ADest. DecodeToStream implements a decoding algorithm that converts the 4-byte representation of encoded data to it's 3-byte un-encoded representation.

DecodeToStream can raise an EIdException with the constant message RSUnevenSizeInDecodeStream when the length of the encoded data in AIn is not a multiple of 4.

DecodeToStream reads 4 bytes of data from AIn and calls DecodeUnit until all contents in the encoded data have been handled. An individual byte in the 3-byte un-encoded value and it's preceding byte will be omitted when the byte value is equal to FillChar.