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.
Whoever opened it disposes it, and what that releases depends on where it came from: one opened on its own owns the parse behind it, and one taken from an IOpenedEmailAttachmentWalk is a view over a parse the walk owns, so disposing it releases nothing and disposing the walk releases everything. Nothing here is buffered either way: 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.