//use for encoding headers
        internal IEncodableStream GetEncoderForHeader(Encoding encoding, bool useBase64Encoding, int headerTextLength)
        {
            byte[] header = CreateHeader(encoding, useBase64Encoding);
            byte[] footer = CreateFooter();

            WriteStateInfoBase writeState;

            if (useBase64Encoding)
            {
                writeState = new Base64WriteStateInfo(InitialBufferSize, header, footer, DefaultMaxLineLength, headerTextLength, encoding);
                return(new Base64Stream((Base64WriteStateInfo)writeState));
            }

            writeState = new WriteStateInfoBase(InitialBufferSize, header, footer, DefaultMaxLineLength, headerTextLength, encoding);
            return(new QEncodedStream(writeState));
        }
Exemplo n.º 2
0
 internal QEncodedStream(WriteStateInfoBase wsi) : base(new MemoryStream())
 {
     _writeState = wsi;
 }