System.IO.Stream.CanWrite Property

When overridden in a derived class, gets a value indicating whether the current stream supports writing.

Syntax

public abstract bool CanWrite { get; }

Value

true if the stream supports writing; otherwise, false.

Remarks

If a class derived from System.IO.Stream does not support writing, a call to Stream.Write(Byte[], int, int), Stream.BeginWrite(Byte[], int, int, AsyncCallback, object), or Stream.WriteByte(byte) throws a NotSupportedException.

If the stream is closed, this property returns false.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0