Base64Encode(Byte, Int32, Int32, Base64FormattingOptions) Method

Converts a subset of a Byte array to its equivalent Base64-encoded string representation. Parameters specify the subset as an offset in the input array, the number of bytes to be converted, and whether newlines are to be inserted in the return value.

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
C#
public static string Encode(
	byte[] bytes,
	int offset,
	int length,
	Base64FormattingOptions options = Base64FormattingOptions.None
)

Parameters

bytes  Byte
A Byte array that contains the data to encode.
offset  Int32
An offset in bytes.
length  Int32
The number of Bytes that are to be converted.
options  Base64FormattingOptions  (Optional)
One of the enumeration values, which specify whether or not line breaks are to be inserted into the return value. The default is None.

Return Value

String
The Base64 string representation of length Bytes taken from the Array bytes beginning at the index offset.

Exceptions

ArgumentNullExceptionbytes is null.
ArgumentOutOfRangeException

offset or length are negative values.

- oder -

offset plus length is greater than the length of bytes.

ArgumentExceptionoptions is not a defined Base64FormattingOptions value.

See Also