Example #1
0
 public IAsyncOperationWithProgress <IBuffer, ulong> ReadAsBufferAsync()
 {
     return(AsyncInfo.Run <IBuffer, ulong>(async(token, progress) =>
     {
         return (await content.ReadAsByteArrayAsync()).AsBuffer();
     }));
 }
Example #2
0
        public static async Task <object> ToByteArrayContentAsync(this SystemHttpContent source)
        {
            if (source is null)
            {
                return(null);
            }

            return(new ByteArrayContent(await source.ReadAsByteArrayAsync()));
        }