private void FlushDecoder(Decoder decoder, bool allowControlCharacters, ref byte[] byteBuffer, ref char[] charBuffer, StringBuilder sb)
        {
            int  num;
            int  num2;
            bool flag;

            decoder.Convert(byteBuffer, 0, 0, charBuffer, 0, charBuffer.Length, true, out num, out num2, out flag);
            if (num2 != 0)
            {
                if (!allowControlCharacters)
                {
                    ValueDecoder.RemoveProhibitedControlCharacters(charBuffer, 0, num2);
                }
                sb.Append(charBuffer, 0, num2);
            }
        }
        private void FlushDecodedBytes(byte[] byteBuffer, int byteBufferLength, Decoder decoder, bool allowControlCharacters, char[] charBuffer, StringBuilder sb)
        {
            int  num = 0;
            bool flag;

            do
            {
                int num2;
                int num3;
                decoder.Convert(byteBuffer, num, byteBufferLength, charBuffer, 0, charBuffer.Length, false, out num2, out num3, out flag);
                if (num3 != 0)
                {
                    if (!allowControlCharacters)
                    {
                        ValueDecoder.RemoveProhibitedControlCharacters(charBuffer, 0, num3);
                    }
                    sb.Append(charBuffer, 0, num3);
                }
                num += num2;
                byteBufferLength -= num2;
            }while (!flag);
        }
        private void ConvertRawFragment(ValuePosition start, ValuePosition end, Decoder decoder, bool allowControlCharacters, ref char[] charBuffer, StringBuilder sb)
        {
            ValueIterator valueIterator = new ValueIterator(this.iterator.Lines, this.iterator.LinesMask, start, end);

            if (!valueIterator.Eof)
            {
                if (charBuffer == null)
                {
                    charBuffer = ScratchPad.GetCharBuffer(Math.Min(1024, this.iterator.TotalLength));
                }
                int  length;
                int  num;
                bool flag;
                do
                {
                    decoder.Convert(valueIterator.Bytes, valueIterator.Offset, valueIterator.Length, charBuffer, 0, charBuffer.Length, false, out length, out num, out flag);
                    if (num != 0)
                    {
                        if (!allowControlCharacters)
                        {
                            ValueDecoder.RemoveProhibitedControlCharacters(charBuffer, 0, num);
                        }
                        sb.Append(charBuffer, 0, num);
                    }
                    valueIterator.Get(length);
                }while (!flag || !valueIterator.Eof);
                decoder.Convert(MimeString.EmptyByteArray, 0, 0, charBuffer, 0, charBuffer.Length, true, out length, out num, out flag);
                if (num != 0)
                {
                    if (!allowControlCharacters)
                    {
                        ValueDecoder.RemoveProhibitedControlCharacters(charBuffer, 0, num);
                    }
                    sb.Append(charBuffer, 0, num);
                }
            }
        }