/// <summary> /// Read the attachment's content from the input stream /// </summary> /// <remarks>Set the ContentType and Filename properties before calling this method</remarks> /// <param name="input">Stream to read the content from</param> public void ReadFrom(Stream input) { using (Stream output = GetWriteStream()) StreamCopier.CopyStream(input, output); CommitWriteStream(ContentType); }
/// <summary> /// Write this attachment's content to the output stream /// </summary> /// <param name="output">Stream to write the content to</param> public void WriteTo(Stream output) { using (Stream input = GetReadStream()) StreamCopier.CopyStream(input, output); }