Example #1
0
 public static async Task <int> ReadStreamMaxBufferAsync(byte[] buffer, Stream stream, CancellationToken cancellationToken)
 {
     return(await CopyUtils.FillBufferAsync(buffer,
                                            async (buf, offset, ct) =>
     {
         return await stream.ReadAsync(buf, offset, buf.Length - offset, ct);
     },
                                            cancellationToken
                                            ));
 }
Example #2
0
 public static string ContentMD5(this HttpResponseMessage response)
 {
     return
         (CopyUtils.GetMD5HashString(response.Content.Headers.ContentMD5) ??
          response.Headers.Where(x => x.Key.Equals("x-amz-meta-content-md5", StringComparison.InvariantCultureIgnoreCase)).Select(z => z.Value.FirstOrDefault()).FirstOrDefault());
 }