Ejemplo n.º 1
0
        // constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="BsonStreamReader" /> class.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="encoding">The encoding.</param>
        /// <exception cref="System.ArgumentNullException">stream</exception>
        public BsonStreamReader(Stream stream, UTF8Encoding encoding)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (encoding == null)
            {
                throw new ArgumentNullException("encoding");
            }

            _stream = stream;
            _bsonStream = stream as IBsonStream;
            _encoding = encoding;
        }
Ejemplo n.º 2
0
        // constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="BsonStreamWriter" /> class.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <param name="encoding">The encoding.</param>
        /// <exception cref="System.ArgumentNullException">stream</exception>
        public BsonStreamWriter(Stream stream, UTF8Encoding encoding)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (encoding == null)
            {
                throw new ArgumentNullException("encoding");
            }

            _stream     = stream;
            _bsonStream = stream as IBsonStream;
            _encoding   = encoding;
        }