Mono Class Library: System.IO.MemoryStream Overview | MembersSystem.IO.MemoryStream.Write Method |
Writes a block of bytes to the current stream at the current position using data read from buffer. [Edit]
|
Type Reason ArgumentNullException buffer is null. [Edit] NotSupportedException The current stream does not support writing.
-or-
The current position is closer than count bytes to the end of the stream, and the capacity cannot be modified.
[Edit]ArgumentException (offset + count ) is greater than the length of buffer. [Edit] ArgumentOutOfRangeException offset or count are negative. [Edit] System.IO.IOException An I/O error occurred. [Edit] ObjectDisposedException The current stream is closed. [Edit]
If the write operation is successful, the current position within the stream is advanced by the number of bytes written. If an exception occurs, the current position within the stream is unchanged.
If the write takes place immediately following a seek beyond the end of the stream, that stream is zero-byte-extended to the new seek position before the given bytes are written.
Write operations at the end of a resizable System.IO.MemoryStream expand the System.IO.MemoryStream.
Note: Use the MemoryStream.CanWrite method to determine whether the current stream supports writing.Note: This method overrides Stream.Write(Byte[], int, int).[Edit]
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0