BigInteger.TryWriteBytes(Span<Byte>, Int32, Boolean, Boolean) 方法

定義

以最小的位元組數複製 BigInteger 此值為小端二補數位元組。 若值為零,則輸出一個元素為0x00的位元組。

public bool TryWriteBytes(Span<byte> destination, out int bytesWritten, bool isUnsigned = false, bool isBigEndian = false);
member this.TryWriteBytes : Span<byte> * int * bool * bool -> bool
Public Function TryWriteBytes (destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional isUnsigned As Boolean = false, Optional isBigEndian As Boolean = false) As Boolean

參數

destination
Span<Byte>

所產生位元組應寫入的目的地區間。

bytesWritten
Int32

寫入 destination的位元組數。

isUnsigned
Boolean

true使用無符號編碼;否則,。 false

isBigEndian
Boolean

true以大端序位元組順序寫入位元組;否則,。 false

傳回

true如果位元組能放入;destinationfalse如果不行,則因空間不足,所有位元組都能寫入。

例外狀況

isUnsignedtrue ,且 Sign 是負值。

適用於