Writes a block of bytes to this stream using data from a buffer.
[Visual Basic] Overrides Public Function Write( _ ByVal array() As Byte, _ ByVal offset As Integer, _ ByVal count As Integer _ ) As Integer [C#] public override int Write( byte[] array, int offset, int count ); [C++] public: override int Write( unsigned char* array[], int offset, int count ); [JScript] public override function Write( array : Byte[], offset : int, count : int ) : int;
Exception Type | Condition |
---|---|
ArgumentNullException | array is a null reference (in Visual Basic Nothing). |
ArgumentException | offset and count describe an invalid range in array. |
ArgumentOutOfRangeException | offset or count are negative. |
IOException | An I/O error occurs. |
NotSupportedException | The stream does not support writing. |
The offset parameter gives the offset of the byte in buffer at which to begin reading, and the count parameter gives the maximum number of bytes that will be written to this 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.