BinaryPrimitives.TryReadSingleBigEndian 方法

定义

从字节只读范围的开头,将 Single 读取为大字节序。

public:
 static bool TryReadSingleBigEndian(ReadOnlySpan<System::Byte> source, [Runtime::InteropServices::Out] float % value);
public static bool TryReadSingleBigEndian (ReadOnlySpan<byte> source, out float value);
static member TryReadSingleBigEndian : ReadOnlySpan<byte> * single -> bool
Public Shared Function TryReadSingleBigEndian (source As ReadOnlySpan(Of Byte), ByRef value As Single) As Boolean

参数

source
ReadOnlySpan<Byte>

要读取的字节只读范围。

value
Single

此方法返回时,将包含作为 big endian 从字节只读范围中读取的值。

返回

如果范围足够大,可以包含 Single,则为 true;否则为 false

注解

从范围开头正好读取 4 个字节。

适用于