Type Reason ArgumentNullException array is null. ArgumentException offset + count is greater than the length of array. ArgumentOutOfRangeException offset or count is negative. System.IO.IOException An I/O error occurred. NotSupportedException The current stream does not support writing. ObjectDisposedException An I/O error occurred.
This method overrides Stream.Write(Byte[], int, int).
The offset parameter gives the offset of the byte in array (the buffer index) at which to begin copying, and the count parameter gives the number of bytes that will be written to the stream. If the write operation is successful, the current position of the stream is advanced by the number of bytes written. If an exception occurs, the current position of the stream is unchanged.
Use the FileStream.CanWrite property to determine whether the current instance supports writing. For additional information, see Stream.CanWrite.
Do not interrupt a thread that is performing a write operation. Although the application may appear to run successfully after the thread is unblocked, the interruption can decrease your application's performance and reliability.
For a list of common file and directory operations, see Common I/O Tasks.