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 以 big-endian 字节顺序写入字节;否则,为 false.

返回

如果字节适合,则为 /> 如果不是所有字节都可能由于空间不足而写入。

例外

isUnsignedtrueSign 为负数。

适用于