MemoryStream.WriteByte Method

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

Writes a byte to the current stream at the current position.

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

Syntax

'Declaration
Public Overrides Sub WriteByte ( _
    value As Byte _
)
public override void WriteByte(
    byte value
)

Parameters

Exceptions

Exception Condition
NotSupportedException

The stream does not support writing. For additional information see CanWrite.

-or-

The current position is at the end of the stream, and the capacity cannot be modified.

ObjectDisposedException

The current stream is closed.

Remarks

This method overrides WriteByte.

Except for a MemoryStream constructed with a byte[] parameter, write operations at the end of a MemoryStream expand the MemoryStream.

Version Information

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

Platforms

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