decodeBinary method
Decodes the data represented by the mime data
Implementation
@override
Uint8List decodeBinary(String? contentTransferEncoding) {
final contentTransferEncodingLC = contentTransferEncoding?.toLowerCase();
if (_bodyStartIndex == null ||
// do not try to decode textual content:
contentTransferEncodingLC == '7bit' ||
contentTransferEncodingLC == '8bit' ||
contentTransferEncodingLC == 'quoted-printable') {
return _bodyData;
}
// even with a 'binary' content transfer encoding there are \r\n
// characters that need to be handled,
// so translate to text first
final dataText = utf8.decode(_bodyData);
return MailCodec.decodeBinary(dataText, contentTransferEncodingLC);
}