public byte[] Download(Uri uri) { using (var tmpFile = new TmpFileCreated()) { _downloader.Download(uri, tmpFile.FilePath); return(File.ReadAllBytes(tmpFile.FilePath.ToString())); } }
public byte[] Download(Uri uri, ITransferProgress progress) { using (var tmpFile = new TmpFileCreated()) { _downloader.Download(uri, tmpFile.FilePath, progress); return(File.ReadAllBytes(tmpFile.FilePath.ToString())); } }
public async Task <byte[]> DownloadAsync(Uri uri, ITransferProgress progress) { using (var tmpFile = new TmpFileCreated()) { await _downloader.DownloadAsync(uri, tmpFile.FilePath, progress).ConfigureAwait(false); return(File.ReadAllBytes(tmpFile.FilePath.ToString())); } }
public async Task <string> DownloadAsync(Uri uri) { using (var tmpFile = new TmpFileCreated()) { await _downloader.DownloadAsync(uri, tmpFile.FilePath).ConfigureAwait(false); return(File.ReadAllText(tmpFile.FilePath.ToString())); } }