- Create a large text file (we called ours taskFile.txt) and place it in a folder called C:\temp\taskFile\:
- In the AsyncDemo class, create a method called ReadBigFile() that returns a Task<TResult> type, which will be used to return an integer of bytes read from our big text file:
public Task<int> ReadBigFile() { }
- Add the following code to open and read the file bytes. You will see that we are using the ReadAsync() method that asynchronously reads a sequence of bytes from the stream and advances the position of that stream by the number of bytes read from that stream. You will also notice that we are using a buffer ...