Class StreamExtensions
Extension methods for the System.IO.Stream class.
Inheritance
System.Object
StreamExtensions
Namespace: Cuemon.IO
Assembly: Cuemon.Core.dll
Syntax
public static class StreamExtensions
Methods
| Improve this DocWriteAsync(Stream, Byte[])
Asynchronously writes a sequence of bytes to the current stream with the entire size of the buffer
starting from position 0.
Declaration
public static Task WriteAsync(this Stream stream, byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The System.IO.Stream to extend. |
System.Byte[] | buffer | The buffer to write data from. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous write operation. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.NotSupportedException | The stream does not support writing. |
System.ObjectDisposedException | The stream has been disposed. |
System.InvalidOperationException | The stream is currently in use by a previous write operation. |