示例#1
0
 private Task <byte[]> FetchObject(HttpWebResponse response, CancellationToken cancellationToken)
 {
     this._lastModified = response.Headers["Last-Modified"];
     this._etag         = response.Headers["ETag"];
     this._cacheControl = response.Headers["CacheControl"];
     return(HttpWebRequestExtensions.ReadAsByteArrayAsync(response, cancellationToken));
 }
示例#2
0
 public async Task <byte[]> GetByteArrayAsync(Uri url, CancellationToken cancellationToken, SM.Media.Web.WebResponse webResponse = null)
 {
     if ((Uri)null != this._baseAddress && !url.IsAbsoluteUri)
     {
         url = new Uri(this._baseAddress, url);
     }
     byte[] numArray;
     using (HttpWebResponse response = await this._webReaderManager.SendAsync(url, (IWebReader)this, cancellationToken, (string)null, (ContentType)null, true, (Uri)null, new long?(), new long?()).ConfigureAwait(false))
     {
         this.Update(url, response, webResponse);
         numArray = await HttpWebRequestExtensions.ReadAsByteArrayAsync(response, cancellationToken).ConfigureAwait(false);
     }
     return(numArray);
 }