/// <inheritdoc/>
 public void Dispose()
 {
     if (!_disposed)
     {
         _disposed = true;
         _chunk.Dispose();
         _chunk = null;
     }
 }
        // constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="SingleChunkBuffer"/> class.
        /// </summary>
        /// <param name="chunk">The chuns.</param>
        /// <param name="length">The length.</param>
        /// <param name="isReadOnly">Whether the buffer is read only.</param>
        public SingleChunkBuffer(IBsonChunk chunk, int length, bool isReadOnly = false)
        {
            if (chunk == null)
            {
                throw new ArgumentNullException("chunk");
            }
            if (length < 0 || length > chunk.Bytes.Count)
            {
                throw new ArgumentOutOfRangeException("length");
            }

            _chunk = chunk;
            _length = length;
            _isReadOnly = isReadOnly;
        }
        // constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="SingleChunkBuffer"/> class.
        /// </summary>
        /// <param name="chunk">The chuns.</param>
        /// <param name="length">The length.</param>
        /// <param name="isReadOnly">Whether the buffer is read only.</param>
        public SingleChunkBuffer(IBsonChunk chunk, int length, bool isReadOnly = false)
        {
            if (chunk == null)
            {
                throw new ArgumentNullException("chunk");
            }
            if (length < 0 || length > chunk.Bytes.Count)
            {
                throw new ArgumentOutOfRangeException("length");
            }

            _chunk      = chunk;
            _length     = length;
            _isReadOnly = isReadOnly;
        }
Exemplo n.º 4
0
 public Reflector(IBsonChunk instance)
 {
     _instance = instance;
 }
 /// <inheritdoc/>
 public void Dispose()
 {
     if (!_disposed)
     {
         _disposed = true;
         _chunk.Dispose();
         _chunk = null;
     }
 }
 public Reflector(IBsonChunk instance)
 {
     _instance = instance;
 }