Writes a sequence of bytes to the current stream and advances the current position within the current stream by the number of bytes written.
Type Reason ArgumentException (offset + count ) is greater than the length of buffer. ArgumentNullException buffer is null. ArgumentOutOfRangeException offset or count is negative. System.IO.IOException An I/O error occurred. NotSupportedException The stream does not support writing. ObjectDisposedException The stream is closed.
Note: Use the Stream.CanWrite property to determine whether the current instance supports writing.Operation
If the write operation is successful, the position within the stream advances by the number of bytes written. If an exception occurs, the position within the stream remains unchanged.
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0