Interface IOpenedEmailAttachment
- Namespace
- MailFathom.Application.EmailContent.Attachments
- Assembly
- MailFathom.Application.dll
One attachment held open long enough to be described and then written out.
public interface IOpenedEmailAttachment : IAsyncDisposable
- Inherited Members
Remarks
Two steps rather than one, because a download states what it is before it says how much of it there is: the media type, the file name, and the length are response headers, and they have to be written before the first octet of the body. A single call returning bytes would have forced the whole file into memory to learn its size.
The instance owns the parse behind it and is disposed by whoever opened it. Nothing here is buffered: the octets are decoded straight into the destination the caller supplies, so a large attachment costs the copy buffer rather than its own size.
Properties
- Description
Gets what the attachment is, measured by the same parse that will write it.
Methods
- WriteContentToAsync(Stream, CancellationToken)
Writes the attachment's decoded octets, and nothing else, to the destination.