private void AppendName(string headerName, int maxBuffer, ref int remaining)
 {
     MimeHeaderReader.DecrementBufferQuota(maxBuffer, ref remaining, headerName.Length * 2);
     if (this.name == null)
     {
         this.name = headerName;
         return;
     }
     this.name += headerName;
 }
        public bool ReadNextPart()
        {
            string arg_06_0 = this.Preface;

            if (this.currentStream != null)
            {
                this.currentStream.Dispose();// Close();
                this.currentStream = null;
            }
            Stream nextStream = this.reader.GetNextStream(MimeReader.CRLFCRLF);

            if (nextStream == null)
            {
                return(false);
            }
            if (this.BlockRead(nextStream, this.scratch, 0, 2) == 2)
            {
                if (this.scratch[0] == 13 && this.scratch[1] == 10)
                {
                    if (this.mimeHeaderReader == null)
                    {
                        this.mimeHeaderReader = new MimeHeaderReader(nextStream);
                    }
                    else
                    {
                        this.mimeHeaderReader.Reset(nextStream);
                    }
                    return(true);
                }
                if (this.scratch[0] == 45 && this.scratch[1] == 45)
                {
                    int num = this.BlockRead(nextStream, this.scratch, 0, 2);
                    if (num < 2 || (this.scratch[0] == 13 && this.scratch[1] == 10))
                    {
                        return(false);
                    }
                }
            }
            throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FormatException(SR.GetString("MimeReaderTruncated", new object[0])));
        }