Internet Direct (Indy) Version 9.0.1 Beta
|
function ReadBody(ADestStream: TStream; var AMsgEnd: Boolean): TIdMessageDecoder; override;
ReadBody examines the message part type to determine the TIdMessageDecoder used for the encoded message part. ReadBody returns the TIdMessageDecoder instance to be used for the message part, or Nil when the message part is not an encoded attachment. When an attachment is detected, the content-transfer-encoding header is used to determine the proper decoder based on the following values of the header:
When the content-transfer-encoding does not match the preceeding values, an EIdException will be raised with the constant message RSMessageCoderMIMEUnrecognizedContentTrasnferEncoding and the value for the message header.
ReadBody reads the message part content, on line at a time, using ReadLn. If a MIMEBoundary is detected in the line, a new TIdMessageDecoderMIME instance is created for the new message part, and the method is exited. ReadBody used the message decoder, when present, to convert the encoded data using TIdMessageDecoder.DecodeToStream. Decoded message part contents are written to ADestStream until a blank line is read from the encoded message part.