BigInteger.GetByteCount(Boolean) Method

Definition

Gets the number of bytes that will be output by ToByteArray(Boolean, Boolean) and TryWriteBytes(Span<Byte>, Int32, Boolean, Boolean).

C#
public int GetByteCount(bool isUnsigned = false);

Parameters

isUnsigned
Boolean

true to use unsigned encoding; otherwise, false.

Returns

The number of bytes.

Applies to

Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.1