BinaryPrimitives.TryReadInt16BigEndian 方法

定義

從只讀位元組區段的開始讀取 , Int16 作為大端序。

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

參數

source
ReadOnlySpan<Byte>

唯讀的位元組範圍。

value
Int16

當此方法回傳時,包含從唯讀位元組區間讀取出來的值,作為大端序。

傳回

true若跨度足夠大以容納;Int16否則,。 false

備註

從區間起始處讀取恰好 2 位元組。

適用於