CopyToAsync Method
Definition
- Namespace
- Cuemon.Extensions.IO
- Assemblies
- Cuemon.Extensions.IO.dll
CopyToAsync(TextReader, TextWriter, int)
Asynchronously reads the bytes from the reader and writes them to the writer.
public static Task CopyToAsync(this TextReader reader, TextWriter writer, int bufferSize = 81920)
Parameters
readerTextReaderThe TextReader to extend.
writerTextWriterThe TextWriter to asynchronously write bytes to.
bufferSizeintThe size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920.
Returns
- Task
A task that represents the asynchronous copy operation.
Exceptions
- ArgumentNullException
readercannot be null -or-writercannot be null.- ArgumentOutOfRangeException
bufferSizeis lower than or equal to 0.