IsolatedStorageFileStream.Write Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Writes a block of bytes to the IsolatedStorageFileStream object using data read from a byte array.

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


<SecuritySafeCriticalAttribute> _
Public Overrides Sub Write ( _
    buffer As Byte(), _
    offset As Integer, _
    count As Integer _
public override void Write(
    byte[] buffer,
    int offset,
    int count


  • buffer
    Type: array<System.Byte[]
    The buffer to write.
  • offset
    Type: System.Int32
    The byte offset in buffer from which to begin.
  • count
    Type: System.Int32
    The maximum number of bytes to write.


Exception Condition

The isolated store has been removed.


The write attempt exceeds the quota for the IsolatedStorageFileStream object.


Isolated storage is disabled.


offset and count describe an invalid range in buffer.


buffer is nulla null reference (Nothing in Visual Basic).


offset or count is negative.


The stream is closed or an internal error has occurred.


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


The stream does not support writing.


The stream has been disposed.


The offset parameter gives the offset of the byte in the buffer at which to begin reading, and the count parameter gives the number of bytes that will be written to this IsolatedStorageFileStream object. If the write operation is successful, the current position of the IsolatedStorageFileStream object is advanced by the number of bytes written. If an exception occurs, the current position of the IsolatedStorageFileStream object is unchanged.

Version Information


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.