Пример #1
0
        /// <summary>
        /// Parses MIME entiry from the specified stream.
        /// </summary>
        /// <param name="stream">Source stream.</param>
        /// <param name="defaultContentType">Default content type.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>stream</b> or <b>defaultContentType</b> is null reference.</exception>
        internal void Parse(SmartStream stream, MIME_h_ContentType defaultContentType)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (defaultContentType == null)
            {
                throw new ArgumentNullException("defaultContentType");
            }

            m_pHeader.Parse(stream);
            Body = m_pBodyProvider.Parse(this, stream, ContentType ?? defaultContentType);
        }
Пример #2
0
        /// <summary>
        /// Parses MIME entiry from the specified stream.
        /// </summary>
        /// <param name="stream">Source stream.</param>
        /// <param name="defaultContentType">Default content type.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>stream</b> or <b>defaultContentType</b> is null reference.</exception>
        internal void Parse(SmartStream stream, MIME_h_ContentType defaultContentType)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (defaultContentType == null)
            {
                throw new ArgumentNullException("defaultContentType");
            }

            m_pHeader.Parse(stream);
            Body = m_pBodyProvider.Parse(this, stream, ContentType??defaultContentType);
        }