Example #1
0
        internal MimeWriter(Stream stream, string boundary)
        {
            if (stream == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream");
            if (boundary == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("boundary");

            this.stream = stream;
            this.boundaryBytes = MimeWriter.GetBoundaryBytes(boundary);
            this.state = MimeWriterState.Start;
            this.bufferedWrite = new BufferedWrite();
        }
 public MimeReader(Stream stream, string boundary)
 {
     if (stream == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("stream");
     }
     if (boundary == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("boundary");
     }
     this.reader        = new DelimittedStreamReader(stream);
     this.boundaryBytes = MimeWriter.GetBoundaryBytes(boundary);
     this.reader.Push(this.boundaryBytes, 0, 2);
 }