Stream.ReadExactly 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| ReadExactly(Span<Byte>) |
从当前流中读取字节,并推进流中的位置, |
| ReadExactly(Byte[], Int32, Int32) |
|
ReadExactly(Span<Byte>)
- Source:
- Stream.cs
- Source:
- Stream.cs
- Source:
- Stream.cs
从当前流中读取字节,并推进流中的位置, buffer 直到 填充 。
public:
void ReadExactly(Span<System::Byte> buffer);
public void ReadExactly (Span<byte> buffer);
member this.ReadExactly : Span<byte> -> unit
Public Sub ReadExactly (buffer As Span(Of Byte))
参数
例外
在填充 buffer之前到达流的末尾。
注解
如果 buffer 为空,则无需等待流中的可用数据即可完成此读取操作。
适用于
ReadExactly(Byte[], Int32, Int32)
- Source:
- Stream.cs
- Source:
- Stream.cs
- Source:
- Stream.cs
count从当前流中读取字节数,并推进流中的位置。
public:
void ReadExactly(cli::array <System::Byte> ^ buffer, int offset, int count);
public void ReadExactly (byte[] buffer, int offset, int count);
member this.ReadExactly : byte[] * int * int -> unit
Public Sub ReadExactly (buffer As Byte(), offset As Integer, count As Integer)
参数
- buffer
- Byte[]
字节数组。 此方法返回时,缓冲区包含指定的字节数组,其值介于 offset 和 (offset + count - 1) 替换为从当前流读取的字节。
- offset
- Int32
buffer 中的字节偏移量,从该偏移量开始存储从当前流中读取的数据。
- count
- Int32
要从当前流中读取的字节数。
例外
buffer 为 null。
offset 在 buffer 的界限外。
- 或 -
count 为负数。
或
和 count 的组合offset指定的范围超过了 的buffer长度。
在读取 count 字节数之前到达流的末尾。
注解
当 为 0 (零) 时 count ,此读取操作将完成,而无需等待流中的可用数据。