コード例 #1
0
ファイル: MimePart.cs プロジェクト: dox0/DotNet471RS3
        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);
        }
コード例 #2
0
ファイル: BaseWriter.cs プロジェクト: dox0/DotNet471RS3
        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);
        }
コード例 #3
0
ファイル: MimePart.cs プロジェクト: REALTOBIZ/mono
        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;
        }
コード例 #4
0
ファイル: BaseWriter.cs プロジェクト: REALTOBIZ/mono
        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;
        }
コード例 #5
0
ファイル: BaseWriter.cs プロジェクト: BclEx/BclEx-Extend
 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;
 }