Share via


MimeReader.CopyOuterContentTo Method

The CopyOuterContentTo method copies a whole MIME part, both headers and content, into stream.

Namespace:  Microsoft.Exchange.Data.Mime
Assembly:  Microsoft.Exchange.Data.Common (in Microsoft.Exchange.Data.Common.dll)

Syntax

'Declaration
Public Sub CopyOuterContentTo ( _
    stream As Stream _
)
'Usage
Dim instance As MimeReader
Dim stream As Stream

instance.CopyOuterContentTo(stream)
public void CopyOuterContentTo(
    Stream stream
)

Parameters

  • stream
    Type: System.IO.Stream
    The stream into which to copy the headers and content for the current part.

Remarks

CopyOuterContentTo can only be called immediately after a call to ReadNextPart before any methods are called that change the current location. Doing this will cause CopyOuterContentTo to throw an exception.

When it is called after a call to ReadNextPart, CopyOuterContentTo copies all the current part, including headers, content, and the headers and content of any nested parts, into stream. After you call the CopyOuterContentTo method on a part, you cannot call the CopyOuterContentTo method on any child parts. The stream is automatically flushed and reset as soon as the reader reaches the end of the part that includes any embedded message readers.

CopyOuterContentTo can be useful for clear-signed hash calculation.