Share via


MemoryStream.CanWrite Property

Gets a value indicating whether the current stream supports writing.

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

Syntax

public override bool CanWrite { get; }

Property Value

true if the stream supports writing; otherwise, false.

Remarks

If a class derived from Stream does not support writing, a call to SetLength, Write, or WriteByte throws a NotSupportedException. If the stream is closed, this property returns false.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, and 4.1.

See Also

Reference

MemoryStream Class
MemoryStream Members
System.IO Namespace