InvokeToByteArray Method
Definition
- Assemblies
- Cuemon.Kernel.dll
InvokeToByteArray(IDecorator<Stream>, int, bool)
Converts the enclosed Stream to its byte array representation.
public static byte[] InvokeToByteArray(this IDecorator<Stream> decorator, int bufferSize = 81920, bool leaveOpen = false)
Parameters
decoratorIDecorator<Stream>The IDecorator<T> that wraps the source stream.
bufferSizeintThe size of the buffer, in bytes. The value must be greater than zero. The default is 81920.
leaveOpenbool
Returns
Remarks
This API supports the product infrastructure and is not intended to be used directly from application code.
Exceptions
- ArgumentNullException
decoratoris null.- ArgumentException
The enclosed Stream does not support reading.