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
属性值
如果流支持写入,则为 true;否则为 false。true if the stream supports writing; otherwise, false.
注解
如果从派生的类不 Stream 支持写入,则对、或的调用将 SetLength Write WriteByte 引发 NotSupportedException 。If a class derived from Stream does not support writing, a call to SetLength, Write, or WriteByte throws a NotSupportedException.
如果流已关闭,则此属性返回 false 。If the stream is closed, this property returns false.