internal Stream GetEncodedStream(Stream stream) { Stream outputStream = stream; if (TransferEncoding == TransferEncoding.Base64) { outputStream = new Base64Stream(outputStream, new Base64WriteStateInfo()); } else if (TransferEncoding == TransferEncoding.QuotedPrintable) { outputStream = new QuotedPrintableStream(outputStream, true); } else if (TransferEncoding == TransferEncoding.SevenBit || TransferEncoding == TransferEncoding.EightBit) { outputStream = new EightBitStream(outputStream); } return(outputStream); }
private Stream GetContentStream(MultiAsyncResult multiResult) { if (this.isInContent) { throw new InvalidOperationException(SR.GetString(SR.MailWriterIsInContent)); } this.isInContent = true; CheckBoundary(); this.bufferBuilder.Append(CRLF); Flush(multiResult); Stream tempStream = new EightBitStream(this.stream, shouldEncodeLeadingDots); ClosableStream cs = new ClosableStream(tempStream, this.onCloseHandler); this.contentStream = cs; return(cs); }
internal Stream GetEncodedStream(Stream stream){ Stream outputStream = stream; if (TransferEncoding == TransferEncoding.Base64) { outputStream = new Base64Stream(outputStream, new Base64WriteStateInfo()); } else if (TransferEncoding == TransferEncoding.QuotedPrintable) { outputStream = new QuotedPrintableStream(outputStream,true); } else if (TransferEncoding == TransferEncoding.SevenBit || TransferEncoding == TransferEncoding.EightBit) { outputStream = new EightBitStream(outputStream); } return outputStream; }
private Stream GetContentStream(MultiAsyncResult multiResult) { if (this.isInContent) throw new InvalidOperationException(SR.GetString(SR.MailWriterIsInContent)); this.isInContent = true; CheckBoundary(); this.bufferBuilder.Append(CRLF); Flush(multiResult); Stream tempStream = new EightBitStream(this.stream, shouldEncodeLeadingDots); ClosableStream cs = new ClosableStream(tempStream, this.onCloseHandler); this.contentStream = cs; return cs; }
private Stream GetContentStream(MultiAsyncResult multiResult) { if (_isInContent) throw new InvalidOperationException(SR.GetString("MailWriterIsInContent")); _isInContent = true; CheckBoundary(); _bufferBuilder.Append(CRLF); Flush(multiResult); var stream = new EightBitStream(_stream, _shouldEncodeLeadingDots); var stream2 = new ClosableStream(stream, _onCloseHandler); _contentStream = stream2; return stream2; }