IsolatedStorageFileStream.Read 方法

定义

重载

名称 说明
Read(Byte[], Int32, Int32)

将字节从当前缓冲 IsolatedStorageFileStream 的对象复制到字节数组。

Read(Span<Byte>)

将字节从当前缓冲 IsolatedStorageFileStream 的对象复制到字节范围。

Read(Byte[], Int32, Int32)

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

将字节从当前缓冲 IsolatedStorageFileStream 的对象复制到字节数组。

public:
 override int Read(cli::array <System::Byte> ^ buffer, int offset, int count);
public override int Read(byte[] buffer, int offset, int count);
override this.Read : byte[] * int * int -> int
Public Overrides Function Read (buffer As Byte(), offset As Integer, count As Integer) As Integer

参数

buffer
Byte[]

要将数据写入到的缓冲区。

offset
Int32

要开始写入的缓冲区中的偏移量。

count
Int32

要读取的最大字节数。

返回

读取到的 buffer字节总数。 如果多个字节当前不可用,则这可以小于请求的字节数;如果到达流的末尾,则为零。

注解

参数buffer可以是类的Buffer实例,也可以是下列类型之一的数组:Byte、、SByte、、CharInt16Int32Int64UInt16UInt32UInt64或。 SingleDouble

如果读取操作成功,则流当前位置按读取的字节数进行高级。 如果发生异常,则流的当前位置保持不变。

该方法 Readbuffer 参数视为字节块,而不考虑其实际类型。 同样,始终 offset 以字节为单位指定和 count 参数。 对于buffer字节数组以外的参数,这意味着元素索引或元素数必须乘以字节为单位的元素大小,才能为或offset形成正确的值count

Read仅当到达流的末尾时,该方法才会返回零。 在所有其他情况下,在返回之前, Read 始终从流中读取至少一个字节。 如果在调用IsolatedStorageFileStream对象时没有数据可用Read,该方法将阻止,直到可以返回至少一个字节的数据。

适用于

Read(Span<Byte>)

Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs
Source:
IsolatedStorageFileStream.cs

将字节从当前缓冲 IsolatedStorageFileStream 的对象复制到字节范围。

public:
 override int Read(Span<System::Byte> buffer);
public override int Read(Span<byte> buffer);
override this.Read : Span<byte> -> int
Public Overrides Function Read (buffer As Span(Of Byte)) As Integer

参数

buffer
Span<Byte>

要将数据写入到的缓冲区。

返回

读取到的 buffer字节总数。 如果多个字节当前不可用,则这可以小于请求的字节数;如果到达流的末尾,则为零。

适用于