Imap FolderCreate Stream Method
Create a backing stream for use with the GetMessage, GetBodyPart, and GetStream methods.
Definition
Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
The stream.
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
protected virtual Stream CreateStream(
UniqueId? uid,
string section,
long offset,
long length
)Parameters
- uid NullableUniqueId
- The unique identifier of the message, if available.
- section String
- The section of the message that is being fetched.
- offset Int64
- The starting offset of the message section being fetched.
- length Int64
- The length of the stream being fetched, measured in bytes.
Return Value
StreamThe stream.
Remarks
Allows subclass implementations to override the type of stream created for use with the GetMessage, GetBodyPart and GetStream methods.
This could be useful for subclass implementations that intend to implement support for caching and/or for subclass implementations that want to use temporary file streams instead of memory-based streams for larger amounts of message data.
Subclasses that implement caching using this API should wait for CommitStream(Stream, UniqueId, String, Int64, Int64) before adding the stream to their cache.
Streams returned by this method SHOULD clean up any allocated resources such as deleting temporary files from the file system.