Esempio n. 1
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "BsonWriter" /> class.
 /// </summary>
 /// <param name = "stream">The stream.</param>
 /// <param name = "descriptor">The descriptor.</param>
 public BsonWriter(Stream stream, IBsonObjectDescriptor descriptor)
 {
     _stream     = stream;
     _descriptor = descriptor;
     _writer     = new BinaryWriter(_stream);
     _buffer     = new byte[BufferLength];
     _maxChars   = BufferLength / Encoding.UTF8.GetMaxByteCount(1);
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref = "BsonWriter" /> class.
 /// </summary>
 /// <param name = "stream">The stream.</param>
 /// <param name = "descriptor">The descriptor.</param>
 public BsonWriter(Stream stream, IBsonObjectDescriptor descriptor)
 {
     _stream = stream;
     _descriptor = descriptor;
     _writer = new BinaryWriter(_stream);
     _buffer = new byte[BufferLength];
     _maxChars = BufferLength/Encoding.UTF8.GetMaxByteCount(1);
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BsonWriterSettings"/> class.
        /// </summary>
        /// <param name="descriptor">The descriptor.</param>
        public BsonWriterSettings(IBsonObjectDescriptor descriptor)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException("descriptor");
            }

            Descriptor = descriptor;
        }
 /// <summary>
 ///   Initializes a new instance of the <see cref = "BsonWriter" /> class.
 /// </summary>
 /// <param name = "stream">The stream.</param>
 /// <param name = "settings">The settings.</param>
 public BsonWriter(Stream stream, BsonWriterSettings settings)
 {
     if(settings == null)
         throw new ArgumentNullException("settings");
     _stream = stream;
     _descriptor = settings.Descriptor;
     _writer = new BinaryWriter(_stream);
     _buffer = new byte[BufferLength];
     _maxChars = BufferLength/Encoding.UTF8.GetMaxByteCount(1);
 }
Esempio n. 5
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "BsonWriter" /> class.
 /// </summary>
 /// <param name = "stream">The stream.</param>
 /// <param name = "settings">The settings.</param>
 public BsonWriter(Stream stream, BsonWriterSettings settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException("settings");
     }
     _stream     = stream;
     _descriptor = settings.Descriptor;
     _writer     = new BinaryWriter(_stream);
     _buffer     = new byte[BufferLength];
     _maxChars   = BufferLength / Encoding.UTF8.GetMaxByteCount(1);
 }
Esempio n. 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BsonWriterSettings"/> class.
        /// </summary>
        /// <param name="descriptor">The descriptor.</param>
        public BsonWriterSettings(IBsonObjectDescriptor descriptor){
            if(descriptor == null)
                throw new ArgumentNullException("descriptor");

            Descriptor = descriptor;
        }