public void Check_copy_async() { var ms = PrepareSourceStream(); var tested = new NarrowedStream(ms, 0, ms.Length - 1); var reader = new StreamReader(tested); var result = new MemoryStream(); tested.CopyToAsync(result).Wait(); Assert.Equal(500000 * 6, result.Length); }
public static Task CopyToAsync(this Stream self, Stream destination, long from, long to) { var limitedStream = new NarrowedStream(self, from, to); return(limitedStream.CopyToAsync(destination, StorageConstants.MaxPageSize)); }