MemoryStream.CanRead 属性

定义

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

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

属性值

如果流是打开的,则为 truetrue if the stream is open.

注解

如果从 Stream 派生的类不支持读取,则对 ReadReadByte 方法的调用将引发 NotSupportedExceptionIf a class derived from Stream does not support reading, calls to the Read and ReadByte methods throw a NotSupportedException.

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

适用于

另请参阅