Class TextReaderDecoratorExtensions
- Namespace
- Cuemon.IO
- Assembly
- Cuemon.IO.dll
Extension methods for the TextReader class hidden behind the IDecorator<T> interface.
public static class TextReaderDecoratorExtensions
- Inheritance
-
TextReaderDecoratorExtensions
Methods
CopyToAsync(IDecorator<TextReader>, TextWriter, Int32)
Asynchronously reads the bytes from the enclosed TextReader of the specified decorator
and writes them to the writer
.
public static async Task CopyToAsync(this IDecorator<TextReader> decorator, TextWriter writer, int bufferSize = 81920)
Parameters
decorator
IDecorator<TextReader>The IDecorator<T> to extend.
writer
TextWriterThe TextWriter to asynchronously write bytes to.
bufferSize
Int32The 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
decorator
cannot be null -or-writer
cannot be null.- ArgumentOutOfRangeException
bufferSize
is lower than or equal to 0.
See Also
IDecorator<T>
Decorator<T>