ToStreamAsync Method
Definition
- Namespace
- Cuemon.Extensions.IO
- Assemblies
- Cuemon.Extensions.IO.dll
ToStreamAsync(string, Action<AsyncEncodingOptions>)
Converts the specified value to a Stream.
public static Task<Stream> ToStreamAsync(this string value, Action<AsyncEncodingOptions> setup = null)
Parameters
valuestringThe string to extend.
setupAction<AsyncEncodingOptions>The AsyncEncodingOptions which may be configured.
Returns
- Task<Stream>
A task that represents the asynchronous operation. The task result contains a Stream containing the result of the specified
value.
Remarks
IEncodingOptions will be initialized with DefaultPreambleSequence and DefaultEncoding.
Exceptions
- ArgumentNullException
valuecannot be null.- InvalidEnumArgumentException
setupwas initialized with an invalid Preamble.