public interface IMediaDownloader
Media download which uses download file part by part, by ChunkSize.
Namespace
Google.Apis.DownloadAssembly
Google.Apis.dll
Properties
ChunkSize
int ChunkSize { get; set; }
Gets or sets the chunk size to download, it defines the size of each part.
Property Value | |
---|---|
Type | Description |
Int32 |
Methods
Download(String, Stream)
IDownloadProgress Download(string url, Stream stream)
Downloads synchronously the given URL to the given stream.
Parameters | |
---|---|
Name | Description |
url | String |
stream | Stream |
Returns | |
---|---|
Type | Description |
IDownloadProgress |
DownloadAsync(String, Stream)
Task<IDownloadProgress> DownloadAsync(string url, Stream stream)
Downloads asynchronously the given URL to the given stream.
Parameters | |
---|---|
Name | Description |
url | String |
stream | Stream |
Returns | |
---|---|
Type | Description |
Task<IDownloadProgress> |
DownloadAsync(String, Stream, CancellationToken)
Task<IDownloadProgress> DownloadAsync(string url, Stream stream, CancellationToken cancellationToken)
Downloads asynchronously the given URL to the given stream. This download method supports a cancellation token to cancel a request before it was completed.
Parameters | |
---|---|
Name | Description |
url | String |
stream | Stream |
cancellationToken | CancellationToken |
Returns | |
---|---|
Type | Description |
Task<IDownloadProgress> |
In case the download fails Exception will contain the exception that cause the failure. The only exception which will be thrown is TaskCanceledException which indicates that the task was canceled.
Events
ProgressChanged
event Action<IDownloadProgress> ProgressChanged
An event which notifies when the download status has been changed.
Event Type | |
---|---|
Type | Description |
Action<IDownloadProgress> |