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;否则为 falsetrue if the stream supports writing; otherwise, false.

注解

如果从 Stream 派生的类不支持写入,则对 SetLengthWriteWriteByte 的调用将引发 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.

适用于

另请参阅