Windows Dev Center

FileStream.Write Method

Writes a block of bytes to this stream using data from a buffer.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public override void Write(
	byte[] array,
	int offset,
	int count
)

Parameters

array
Type: System.Byte []
The buffer containing data to write to the stream.
offset
Type: System.Int32
The zero-based byte offset in array at which to begin copying bytes to the current stream.
count
Type: System.Int32
The number of bytes to be written to the current stream.

ExceptionCondition
ArgumentNullException

array is null.

ArgumentException

offset and count describe an invalid range in array.

ArgumentOutOfRangeException

offset or count is negative.

IOException

An I/O error occurs.

- or -

Another thread may have caused an unexpected change in the position of the operating system's file handle.

ObjectDisposedException

The stream is closed.

NotSupportedException

The current stream instance does not support writing.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2015 Microsoft