Base64GetEncodedLength Method

Calculates the exact output length of Base64-encoded data from the input length of the data to be encoded.

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
C#
public static int GetEncodedLength(
	int length
)

Parameters

length  Int32
The number of Bytes to convert to Base64 format.

Return Value

Int32
The number of characters of the Base64-encoded output when length Bytes are encoded.

Remarks

Any line breaks that might have to be inserted into the encoded output are not included in the calculation.

Exceptions

ArgumentOutOfRangeExceptionlength is less than 0 or as large that the return value would be greater than Int32.MaxValue.

See Also