Exemplo n.º 1
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     MimeCommon.CheckBufferArguments(buffer, offset, count);
     if (this.writer.contentWritten)
     {
         throw new InvalidOperationException(Strings.ContentAlreadyWritten);
     }
     this.writer.Write(buffer, offset, count);
 }
Exemplo n.º 2
0
        public void WriteRawContent(byte[] buffer, int offset, int count)
        {
            MimeCommon.CheckBufferArguments(buffer, offset, count);
            this.AssertOpen();
            if (this.contentWritten)
            {
                throw new InvalidOperationException(Strings.ContentAlreadyWritten);
            }
            Stream rawContentWriteStream = this.partContent;

            if (rawContentWriteStream == null)
            {
                rawContentWriteStream = this.GetRawContentWriteStream();
            }
            rawContentWriteStream.Write(buffer, offset, count);
        }
Exemplo n.º 3
0
 public void WriteContent(byte[] buffer, int offset, int count)
 {
     MimeCommon.CheckBufferArguments(buffer, offset, count);
     this.AssertOpen();
     if (this.contentWritten)
     {
         throw new InvalidOperationException(Strings.ContentAlreadyWritten);
     }
     if (this.encodedPartContent != null)
     {
         this.encodedPartContent.Write(buffer, offset, count);
         return;
     }
     using (Stream contentWriteStream = this.GetContentWriteStream())
     {
         contentWriteStream.Write(buffer, offset, count);
     }
 }