ToByteArray Method
Definition
- Assemblies
- Cuemon.IO.dll
ToByteArray(IDecorator<Stream>, Action<StreamCopyOptions>)
Converts the enclosed Stream of the specified decorator to its equivalent byte array representation.
public static byte[] ToByteArray(this IDecorator<Stream> decorator, Action<StreamCopyOptions> setup = null)
Parameters
decoratorIDecorator<Stream>The IDecorator<T> to extend.
setupAction<StreamCopyOptions>The StreamCopyOptions which may be configured.
Returns
Exceptions
- ArgumentNullException
decoratorcannot be null.- ArgumentException
The enclosed Stream of
decoratorcannot be read from.