ToStreamAsync Method
Definition
- Namespace
- Cuemon.Extensions.IO
- Assemblies
- Cuemon.Extensions.IO.dll
ToStreamAsync(byte[], CancellationToken)
Converts the specified bytes to its equivalent Stream representation.
public static Task<Stream> ToStreamAsync(this byte[] bytes, CancellationToken cancellationToken = default)
Parameters
bytesbyte[]The byte array to extend.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests. The default value is None.
Returns
- Task<Stream>
A task that represents the asynchronous operation. The task result contains a Stream that is equivalent to
bytes.
Exceptions
- ArgumentNullException
bytescannot be null.