MemoryStream.CanWrite 属性

定义

获取一个值,该值指示当前流是否支持写入。Gets a value indicating whether the current stream supports writing.

public:
 virtual property bool CanWrite { bool get(); };
public override bool CanWrite { get; }
member this.CanWrite : bool
Public Overrides ReadOnly Property CanWrite As Boolean

属性值

Boolean

如果流支持写入,则为 true;否则为 falsetrue if the stream supports writing; otherwise, false.

注解

如果从派生的类不 Stream 支持写入,则对、或的调用将 SetLength Write WriteByte 引发 NotSupportedExceptionIf a class derived from Stream does not support writing, a call to SetLength, Write, or WriteByte throws a NotSupportedException.

如果流已关闭,则此属性返回 falseIf the stream is closed, this property returns false.

适用于