CopyToAsync Method
Definition
- Assemblies
- Cuemon.IO.dll
CopyToAsync(IDecorator<TextReader>, TextWriter, int)
Asynchronously reads the bytes from the enclosed TextReader of the specified decorator and writes them to the writer.
public static Task CopyToAsync(this IDecorator<TextReader> decorator, TextWriter writer, int bufferSize = 81920)
Parameters
decoratorIDecorator<TextReader>The IDecorator<T> 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
decoratorcannot be null -or-writercannot be null.- ArgumentOutOfRangeException
bufferSizeis lower than or equal to 0.