Rediger

Del via


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

Definition

Copies the value of this BigInteger as little-endian twos-complement bytes, using the fewest number of bytes possible. If the value is zero, outputs one byte whose element is 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

Parameters

destination
Span<Byte>

The destination span to which the resulting bytes should be written.

bytesWritten
Int32

The number of bytes written to destination.

isUnsigned
Boolean

true to use unsigned encoding; otherwise, false.

isBigEndian
Boolean

true to write the bytes in a big-endian byte order; otherwise, false.

Returns

true if the bytes fit in destination; false if not all bytes could be written due to lack of space.

Exceptions

isUnsigned is true and Sign is negative.

Applies to