BinaryPrimitives.TryReadInt64BigEndian(ReadOnlySpan<Byte>, Int64) 方法

定义

从字节只读范围的开头,将 Int64 读取为大字节序。Reads an Int64 from the beginning of a read-only span of bytes, as big endian.

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

参数

source
ReadOnlySpan<Byte>

要读取的字节只读范围。The read-only span of bytes to read.

value
Int64

此方法返回时,值作为大字节序从字节只读范围中读取。When this method returns, the value read out of the read-only span of bytes, as big endian.

返回

Boolean

如果范围足够大,可以包含 Int64,则为 true;否则为 falsetrue if the span is large enough to contain an Int64; otherwise, false.

注解

从跨度的开头精确读取8个字节。Reads exactly 8 bytes from the beginning of the span.

适用于