// 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; }
// 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; }