Esempio n. 1
0
 public byte[] Download(Uri uri)
 {
     using (var tmpFile = new TmpFileCreated()) {
         _downloader.Download(uri, tmpFile.FilePath);
         return(File.ReadAllBytes(tmpFile.FilePath.ToString()));
     }
 }
Esempio n. 2
0
 public byte[] Download(Uri uri, ITransferProgress progress)
 {
     using (var tmpFile = new TmpFileCreated()) {
         _downloader.Download(uri, tmpFile.FilePath, progress);
         return(File.ReadAllBytes(tmpFile.FilePath.ToString()));
     }
 }
Esempio n. 3
0
        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()));
            }
        }
Esempio n. 4
0
        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()));
            }
        }