Interface IMediaDownloader
Media download which uses download file part by part, by Chunk
Namespace: Google.Apis.Download
Assembly: Google.Apis.dll
Syntax
public interface IMediaDownloader
Properties
ChunkSize
Gets or sets the chunk size to download, it defines the size of each part.
Declaration
int ChunkSize { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
Download(string, Stream)
Downloads synchronously the given URL to the given stream.
Declaration
IDownloadProgress Download(string url, Stream stream)
Parameters
Returns
Type | Description |
---|---|
IDownload |
DownloadAsync(string, Stream)
Downloads asynchronously the given URL to the given stream.
Declaration
Task<IDownloadProgress> DownloadAsync(string url, Stream stream)
Parameters
Returns
Type | Description |
---|---|
Task<IDownload |
DownloadAsync(string, Stream, 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.
Declaration
Task<IDownloadProgress> DownloadAsync(string url, Stream stream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | url | |
Stream | stream | |
Cancellation |
cancellationToken |
Returns
Type | Description |
---|---|
Task<IDownload |
Remarks
In case the download fails Exception will contain the exception that
cause the failure. The only exception which will be thrown is
Task
Events
ProgressChanged
An event which notifies when the download status has been changed.
Declaration
event Action<IDownloadProgress> ProgressChanged
Event Type
Type | Description |
---|---|
Action<IDownload |