Ejemplo n.º 1
0
 internal Stream GetClosableStream()
 {
     ClosableStream cs = new ClosableStream(_networkStream, _onCloseHandler);
     _isStreamOpen = true;
     return cs;
 }
 internal Stream GetClosableStream()
 {
     ClosableStream stream = new ClosableStream(this.pooledStream.NetworkStream, this.onCloseHandler);
     this.isStreamOpen = true;
     return stream;
 }
 private Stream GetContentStream(ContentTransferEncoding contentTransferEncoding, MultiAsyncResult multiResult)
 {
     if (this.isInContent)
     {
         throw new InvalidOperationException(SR.GetString("MailWriterIsInContent"));
     }
     this.isInContent = true;
     this.bufferBuilder.Append(CRLF);
     this.Flush(multiResult);
     Stream stream = this.stream;
     if (contentTransferEncoding == ContentTransferEncoding.SevenBit)
     {
         stream = new SevenBitStream(stream);
     }
     else if (contentTransferEncoding == ContentTransferEncoding.QuotedPrintable)
     {
         stream = new QuotedPrintableStream(stream, this.lineLength);
     }
     else if (contentTransferEncoding == ContentTransferEncoding.Base64)
     {
         stream = new Base64Stream(stream, this.lineLength);
     }
     ClosableStream stream2 = new ClosableStream(stream, this.onCloseHandler);
     this.contentStream = stream2;
     return stream2;
 }
Ejemplo n.º 4
0
 internal Stream GetClosableStream()
 {
     ClosableStream cs = new ClosableStream(pooledStream.NetworkStream, onCloseHandler);
     isStreamOpen = true;
     return cs;
 }
 private Stream GetContentStream(ContentTransferEncoding contentTransferEncoding, MultiAsyncResult multiResult)
 {
     this.CheckBoundary();
     this.bufferBuilder.Append(CRLF);
     this.Flush(multiResult);
     Stream stream = this.stream;
     if (contentTransferEncoding == ContentTransferEncoding.SevenBit)
     {
         stream = new SevenBitStream(stream);
     }
     else if (contentTransferEncoding == ContentTransferEncoding.QuotedPrintable)
     {
         stream = new QuotedPrintableStream(stream, this.lineLength);
     }
     else if (contentTransferEncoding == ContentTransferEncoding.Base64)
     {
         stream = new Base64Stream(stream, this.lineLength);
     }
     ClosableStream stream2 = new ClosableStream(stream, this.onCloseHandler);
     this.contentStream = stream2;
     return stream2;
 }