Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Numerics.​IBinaryInteger`1

Assembly: System.Runtime

Defines an integer type that is represented in a base-2 format.

Methods

public int
GetByteCount​()
Returns The number of bytes that will be written as part of <see cref="M:System.Numerics.IBinaryInteger`1.TryWriteLittleEndian(System.Span{System.Byte},System.Int32@)" /> .
Gets the number of bytes that will be written as part of <see cref="M:System.Numerics.IBinaryInteger`1.TryWriteLittleEndian(System.Span{System.Byte},System.Int32@)" /> .
public int
GetShortestBitLength​()
Returns The length, in bits, of the shortest two's complement representation of the current value.
Gets the length, in bits, of the shortest two's complement representation of the current value.
public bool
TryWriteBigEndian​(Span`1 destination, Int32& bytesWritten)
public bool
TryWriteLittleEndian​(Span`1 destination, Int32& bytesWritten)
public int
WriteBigEndian​(byte[] destination)
destination The array to which the current value should be written.
Returns The number of bytes written to <paramref name="destination" /> .
Writes the current value, in big-endian format, to a given array.
public int
WriteBigEndian​(byte[] destination, int startIndex)
destination The array to which the current value should be written.
startIndex The starting index at which the value should be written.
Returns The number of bytes written to <paramref name="destination" /> starting at <paramref name="startIndex" /> .
Writes the current value, in big-endian format, to a given array.
public int
WriteBigEndian​(Span`1 destination)
public int
WriteLittleEndian​(byte[] destination)
destination The array to which the current value should be written.
Returns The number of bytes written to <paramref name="destination" /> .
Writes the current value, in little-endian format, to a given array.
public int
WriteLittleEndian​(byte[] destination, int startIndex)
destination The array to which the current value should be written.
startIndex The starting index at which the value should be written.
Returns The number of bytes written to <paramref name="destination" /> starting at <paramref name="startIndex" /> .
Writes the current value, in little-endian format, to a specified array starting at a specified index.
public int
WriteLittleEndian​(Span`1 destination)