BinaryPrimitives.TryWriteUInt16BigEndian(Span<Byte>, UInt16) 方法

定義

重要

此 API 不符合 CLS 規範。

將 a UInt16 寫入一個位元組區間,作為大端序。

public:
 static bool TryWriteUInt16BigEndian(Span<System::Byte> destination, System::UInt16 value);
[System.CLSCompliant(false)]
public static bool TryWriteUInt16BigEndian(Span<byte> destination, ushort value);
[<System.CLSCompliant(false)>]
static member TryWriteUInt16BigEndian : Span<byte> * uint16 -> bool
Public Shared Function TryWriteUInt16BigEndian (destination As Span(Of Byte), value As UShort) As Boolean

參數

destination
Span<Byte>

值要寫入的位元組範圍,也就是大端序。

value
UInt16

要寫入位元組區間的值。

傳回

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

屬性

備註

在區間的開頭寫入恰好 2 位元組。

適用於