MSDN Library
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FileStream.Write Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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:
© 2016 Microsoft