public Task DownloadToStreamAsync(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, nameof(id)); Ensure.IsNotNull(destination, nameof(destination)); options = options ?? new GridFSDownloadOptions(); return(DownloadToStreamHelperAsync(id, destination, options, cancellationToken)); }
private async Task <byte[]> DownloadAsBytesHelperAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); return(await DownloadAsBytesHelperAsync(binding, fileInfo, options, cancellationToken).ConfigureAwait(false)); } }
/// <inheritdoc /> public byte[] DownloadAsBytes(TFileId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull((object)id, nameof(id)); options = options ?? new GridFSDownloadOptions(); using (var binding = GetSingleServerReadBinding(cancellationToken)) { var fileInfo = GetFileInfo(binding, id, cancellationToken); return(DownloadAsBytesHelper(binding, fileInfo, options, cancellationToken)); } }
/// <inheritdoc /> public GridFSDownloadStream <TFileId> OpenDownloadStream(TFileId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull((object)id, nameof(id)); options = options ?? new GridFSDownloadOptions(); using (var binding = GetSingleServerReadBinding(cancellationToken)) { var fileInfo = GetFileInfo(binding, id, cancellationToken); return(CreateDownloadStream(binding.Fork(), fileInfo, options, cancellationToken)); } }
/// <inheritdoc /> public void DownloadToStream(TFileId id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull((object)id, nameof(id)); Ensure.IsNotNull(destination, nameof(destination)); options = options ?? new GridFSDownloadOptions(); using (var binding = GetSingleServerReadBinding(cancellationToken)) { var fileInfo = GetFileInfo(binding, id, cancellationToken); DownloadToStreamHelper(binding, fileInfo, destination, options, cancellationToken); } }
/// <inheritdoc /> public async Task DownloadToStreamAsync(TFileId id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull((object)id, nameof(id)); Ensure.IsNotNull(destination, nameof(destination)); options = options ?? new GridFSDownloadOptions(); using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); await DownloadToStreamHelperAsync(binding, fileInfo, destination, options, cancellationToken).ConfigureAwait(false); } }
/// <inheritdoc /> public async Task <byte[]> DownloadAsBytesAsync(TFileId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull((object)id, nameof(id)); options = options ?? new GridFSDownloadOptions(); using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); return(await DownloadAsBytesHelperAsync(binding, fileInfo, options, cancellationToken).ConfigureAwait(false)); } }
private GridFSDownloadStream CreateDownloadStream(IReadBindingHandle binding, GridFSFileInfo fileInfo, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { var checkMD5 = options.CheckMD5 ?? false; var seekable = options.Seekable ?? false; if (checkMD5 && seekable) { throw new ArgumentException("CheckMD5 can only be used when Seekable is false."); } if (seekable) { return new GridFSSeekableDownloadStream(this, binding, fileInfo); } else { return new GridFSForwardOnlyDownloadStream(this, binding, fileInfo, checkMD5); } }
public Task<GridFSDownloadStream> OpenDownloadStreamAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, nameof(id)); options = options ?? new GridFSDownloadOptions(); return OpenDownloadStreamHelperAsync(id, options, cancellationToken); }
/// <inheritdoc /> public Task<byte[]> DownloadAsBytesAsync(ObjectId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { options = options ?? new GridFSDownloadOptions(); return DownloadAsBytesHelperAsync(new BsonObjectId(id), options, cancellationToken); }
private async Task <byte[]> DownloadAsBytesHelperAsync(IReadBindingHandle binding, GridFSFileInfo <TFileId> fileInfo, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { if (fileInfo.Length > int.MaxValue) { throw new NotSupportedException("GridFS stored file is too large to be returned as a byte array."); } var bytes = new byte[(int)fileInfo.Length]; using (var destination = new MemoryStream(bytes)) { await DownloadToStreamHelperAsync(binding, fileInfo, destination, options, cancellationToken).ConfigureAwait(false); return(bytes); } }
private async Task DownloadToStreamAsyncHelper(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var filesCollectionDocument = await GetFilesCollectionDocumentAsync(binding, id, cancellationToken).ConfigureAwait(false); await DownloadToStreamAsyncHelper(binding, filesCollectionDocument, destination, options, cancellationToken).ConfigureAwait(false); } }
/// <summary> /// Opens a Stream that can be used by the application to read data from a GridFS file. /// </summary> /// <param name="id">The file id.</param> /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>A Task whose result is a Stream.</returns> public async Task <GridFSDownloadStream> OpenDownloadStreamAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { var wrappedStream = await _bsonValueBucket.OpenDownloadStreamAsync(id, options, cancellationToken).ConfigureAwait(false); return(new GridFSDownloadStream(wrappedStream)); }
public Task DownloadToStreamAsync(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, nameof(id)); Ensure.IsNotNull(destination, nameof(destination)); return DownloadToStreamHelperAsync(id, destination, options, cancellationToken); }
private void DownloadToStreamHelper(IReadBindingHandle binding, GridFSFileInfo fileInfo, Stream destination, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { var checkMD5 = options.CheckMD5 ?? false; using (var source = new GridFSForwardOnlyDownloadStream(this, binding.Fork(), fileInfo, checkMD5)) { var count = source.Length; var buffer = new byte[fileInfo.ChunkSizeBytes]; while (count > 0) { var partialCount = (int)Math.Min(buffer.Length, count); source.ReadBytes(buffer, 0, partialCount, cancellationToken); //((Stream)source).ReadBytes(buffer, 0, partialCount, cancellationToken); destination.Write(buffer, 0, partialCount); count -= partialCount; } } }
private void DownloadToStreamHelper(BsonValue id, Stream destination, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = GetSingleServerReadBinding(cancellationToken)) { var fileInfo = GetFileInfo(binding, id, cancellationToken); DownloadToStreamHelper(binding, fileInfo, destination, options, cancellationToken); } }
private byte[] DownloadAsBytesHelper(BsonValue id, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = GetSingleServerReadBinding(cancellationToken)) { var fileInfo = GetFileInfo(binding, id, cancellationToken); return DownloadAsBytesHelper(binding, fileInfo, options, cancellationToken); } }
public void DownloadToStream(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, nameof(id)); Ensure.IsNotNull(destination, nameof(destination)); options = options ?? new GridFSDownloadOptions(); DownloadToStreamHelper(id, destination, options, cancellationToken); }
private GridFSDownloadStream OpenDownloadStreamHelper(BsonValue id, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = GetSingleServerReadBinding(cancellationToken)) { var fileInfo = GetFileInfo(binding, id, cancellationToken); return CreateDownloadStream(binding.Fork(), fileInfo, options, cancellationToken); } }
public Task<byte[]> DownloadAsBytesAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, "id"); return DownloadAsBytesAsyncHelper(id, options, cancellationToken); }
public Task<GridFSDownloadStream> OpenDownloadStreamAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, "id"); return OpenDownloadStreamAsyncHelper(id, options, cancellationToken); }
/// <summary> /// Downloads a file stored in GridFS and writes the contents to a stream. /// </summary> /// <param name="id">The file id.</param> /// <param name="destination">The destination.</param> /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>A Task.</returns> public Task DownloadToStreamAsync(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { return(_bsonValueBucket.DownloadToStreamAsync(id, destination, options, cancellationToken)); }
private async Task<GridFSDownloadStream> OpenDownloadStreamHelperAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { options = options ?? new GridFSDownloadByNameOptions(); using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var filesCollectionDocument = await GetFilesCollectionDocumentAsync(binding, id, cancellationToken).ConfigureAwait(false); return CreateDownloadStream(binding.Fork(), filesCollectionDocument, options, cancellationToken); } }
private async Task <byte[]> DownloadAsBytesAsyncHelper(IReadBindingHandle binding, GridFSFilesCollectionDocument filesCollectionDocument, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { if (filesCollectionDocument.Length > int.MaxValue) { throw new NotSupportedException("GridFS stored file is too large to be returned as a byte array."); } using (var destination = new MemoryStream((int)filesCollectionDocument.Length)) { await DownloadToStreamAsyncHelper(binding, filesCollectionDocument, destination, options, cancellationToken).ConfigureAwait(false); return(destination.GetBuffer()); } }
/// <inheritdoc /> public async Task <GridFSDownloadStream <TFileId> > OpenDownloadStreamAsync(TFileId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull((object)id, nameof(id)); options = options ?? new GridFSDownloadOptions(); using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); return(CreateDownloadStream(binding.Fork(), fileInfo, options, cancellationToken)); } }
/// <inheritdoc /> public Task <byte[]> DownloadAsBytesAsync(ObjectId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { return(DownloadAsBytesHelperAsync(new BsonObjectId(id), options, cancellationToken)); }
private async Task<byte[]> DownloadAsBytesAsyncHelper(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var filesCollectionDocument = await GetFilesCollectionDocumentAsync(binding, id, cancellationToken).ConfigureAwait(false); return await DownloadAsBytesAsyncHelper(binding, filesCollectionDocument, options, cancellationToken).ConfigureAwait(false); } }
/// <inheritdoc /> public Task DownloadToStreamAsync(ObjectId id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(destination, nameof(destination)); return(DownloadToStreamHelperAsync(new BsonObjectId(id), destination, options, cancellationToken)); }
public Task <GridFSDownloadStream> OpenDownloadStreamAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, nameof(id)); return(OpenDownloadStreamHelperAsync(id, options, cancellationToken)); }
private GridFSDownloadStream <TFileId> CreateDownloadStream(IReadBindingHandle binding, GridFSFileInfo <TFileId> fileInfo, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { var checkMD5 = options.CheckMD5 ?? false; var seekable = options.Seekable ?? false; if (checkMD5 && seekable) { throw new ArgumentException("CheckMD5 can only be used when Seekable is false."); } if (seekable) { return(new GridFSSeekableDownloadStream <TFileId>(this, binding, fileInfo)); } else { return(new GridFSForwardOnlyDownloadStream <TFileId>(this, binding, fileInfo, checkMD5)); } }
/// <inheritdoc /> public Task <GridFSDownloadStream> OpenDownloadStreamAsync(ObjectId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { return(OpenDownloadStreamHelperAsync(new BsonObjectId(id), options, cancellationToken)); }
private async Task DownloadToStreamHelperAsync(IReadBindingHandle binding, GridFSFileInfo <TFileId> fileInfo, Stream destination, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { var checkMD5 = options.CheckMD5 ?? false; var retryReads = _database.Client.Settings.RetryReads; using (var source = new GridFSForwardOnlyDownloadStream <TFileId>(this, binding.Fork(), fileInfo, checkMD5) { RetryReads = retryReads }) { var count = source.Length; var buffer = new byte[fileInfo.ChunkSizeBytes]; while (count > 0) { var partialCount = (int)Math.Min(buffer.Length, count); await source.ReadBytesAsync(buffer, 0, partialCount, cancellationToken).ConfigureAwait(false); await destination.WriteAsync(buffer, 0, partialCount, cancellationToken).ConfigureAwait(false); count -= partialCount; } await source.CloseAsync(cancellationToken).ConfigureAwait(false); } }
private async Task<byte[]> DownloadAsBytesHelperAsync(IReadBindingHandle binding, GridFSFileInfo fileInfo, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { if (fileInfo.Length > int.MaxValue) { throw new NotSupportedException("GridFS stored file is too large to be returned as a byte array."); } using (var destination = new MemoryStream((int)fileInfo.Length)) { await DownloadToStreamHelperAsync(binding, fileInfo, destination, options, cancellationToken).ConfigureAwait(false); return destination.GetBuffer(); } }
/// <inheritdoc /> public Task DownloadToStreamAsync(ObjectId id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(destination, nameof(destination)); options = options ?? new GridFSDownloadOptions(); return DownloadToStreamHelperAsync(new BsonObjectId(id), destination, options, cancellationToken); }
private async Task DownloadToStreamHelperAsync(BsonValue id, Stream destination, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); await DownloadToStreamHelperAsync(binding, fileInfo, destination, options, cancellationToken).ConfigureAwait(false); } }
/// <inheritdoc /> public Task<GridFSDownloadStream> OpenDownloadStreamAsync(ObjectId id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { options = options ?? new GridFSDownloadOptions(); return OpenDownloadStreamHelperAsync(new BsonObjectId(id), options, cancellationToken); }
public Task<byte[]> DownloadAsBytesAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, nameof(id)); options = options ?? new GridFSDownloadOptions(); return DownloadAsBytesHelperAsync(id, options, cancellationToken); }
private async Task<byte[]> DownloadAsBytesHelperAsync(BsonValue id, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); return await DownloadAsBytesHelperAsync(binding, fileInfo, options, cancellationToken).ConfigureAwait(false); } }
private async Task DownloadToStreamAsyncHelper(IReadBindingHandle binding, GridFSFilesCollectionDocument filesCollectionDocument, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { var checkMD5 = options.CheckMD5 ?? false; using (var source = new GridFSForwardOnlyDownloadStream(this, binding.Fork(), filesCollectionDocument, checkMD5)) { var count = source.Length; var buffer = new byte[filesCollectionDocument.ChunkSizeBytes]; while (count > 0) { var partialCount = (int)Math.Min(buffer.Length, count); await source.ReadBytesAsync(buffer, 0, partialCount, cancellationToken).ConfigureAwait(false); await destination.WriteAsync(buffer, 0, partialCount, cancellationToken).ConfigureAwait(false); count -= partialCount; } await source.CloseAsync(cancellationToken).ConfigureAwait(false); } }
private async Task DownloadToStreamHelperAsync(IReadBindingHandle binding, GridFSFileInfo fileInfo, Stream destination, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { var checkMD5 = options.CheckMD5 ?? false; using (var source = new GridFSForwardOnlyDownloadStream(this, binding.Fork(), fileInfo, checkMD5)) { var count = source.Length; var buffer = new byte[fileInfo.ChunkSizeBytes]; while (count > 0) { var partialCount = (int)Math.Min(buffer.Length, count); await source.ReadBytesAsync(buffer, 0, partialCount, cancellationToken).ConfigureAwait(false); await destination.WriteAsync(buffer, 0, partialCount, cancellationToken).ConfigureAwait(false); count -= partialCount; } await source.CloseAsync(cancellationToken).ConfigureAwait(false); } }
private async Task DownloadToStreamHelperAsync(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); await DownloadToStreamHelperAsync(binding, fileInfo, destination, options, cancellationToken).ConfigureAwait(false); } }
private async Task<GridFSDownloadStream> OpenDownloadStreamHelperAsync(BsonValue id, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); return CreateDownloadStream(binding.Fork(), fileInfo, options, cancellationToken); } }
private async Task <GridFSDownloadStream> OpenDownloadStreamHelperAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { options = options ?? new GridFSDownloadByNameOptions(); using (var binding = await GetSingleServerReadBindingAsync(cancellationToken).ConfigureAwait(false)) { var fileInfo = await GetFileInfoAsync(binding, id, cancellationToken).ConfigureAwait(false); return(CreateDownloadStream(binding.Fork(), fileInfo, options, cancellationToken)); } }
/// <summary> /// Downloads a file stored in GridFS and writes the contents to a stream. /// </summary> /// <param name="id">The file id.</param> /// <param name="destination">The destination.</param> /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> public void DownloadToStream(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { _bsonValueBucket.DownloadToStream(id, destination, options, cancellationToken); }
public Task <byte[]> DownloadAsBytesAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, nameof(id)); return(DownloadAsBytesHelperAsync(id, options, cancellationToken)); }
/// <summary> /// Opens a Stream that can be used by the application to read data from a GridFS file. /// </summary> /// <param name="id">The file id.</param> /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>A Stream.</returns> public GridFSDownloadStream OpenDownloadStream(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { var wrappedStream = _bsonValueBucket.OpenDownloadStream(id, options, cancellationToken); return(new GridFSDownloadStream(wrappedStream)); }
private void DownloadToStreamHelper(IReadBindingHandle binding, GridFSFileInfo <TFileId> fileInfo, Stream destination, GridFSDownloadOptions options, CancellationToken cancellationToken = default(CancellationToken)) { var checkMD5 = options.CheckMD5 ?? false; using (var source = new GridFSForwardOnlyDownloadStream <TFileId>(this, binding.Fork(), fileInfo, checkMD5)) { var count = source.Length; var buffer = new byte[fileInfo.ChunkSizeBytes]; while (count > 0) { var partialCount = (int)Math.Min(buffer.Length, count); source.ReadBytes(buffer, 0, partialCount, cancellationToken); //((Stream)source).ReadBytes(buffer, 0, partialCount, cancellationToken); destination.Write(buffer, 0, partialCount); count -= partialCount; } } }
/// <summary> /// Downloads a file stored in GridFS and returns it as a byte array. /// </summary> /// <param name="id">The file id.</param> /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>A Task whose result is a byte array containing the contents of the file stored in GridFS.</returns> public Task <byte[]> DownloadAsBytesAsync(BsonValue id, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { return(_bsonValueBucket.DownloadAsBytesAsync(id, options, cancellationToken)); }
public Task DownloadToStreamAsync(BsonValue id, Stream destination, GridFSDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { Ensure.IsNotNull(id, "id"); Ensure.IsNotNull(destination, "destination"); return(DownloadToStreamAsyncHelper(id, destination, options, cancellationToken)); }