Export (0) Print
Expand All

FileStream.Write Method

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

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

[SecuritySafeCriticalAttribute]
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.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft