/// <summary> /// Overriden. Obtains an instance from this factory. /// </summary> /// <returns>An <see cref="IObjectStorage"/> instance.</returns> public override IObjectStorage ObtainInstance() { var memoryPool = new MemoryStreamPool(); if (_memoryPoolInitialBufferSize.HasValue) { memoryPool.InitialBufferSize = _memoryPoolInitialBufferSize.Value; } var storage = _storageSection.ObtainInstance(); var ret = new SerializingObjectStorage(); ret.Initialize(new SerializingObjectStorageConfig { StreamPool = memoryPool, Storage = storage }); return(ret); }