DataUrlFromBytes(IEnumerableByte, MimeTypeInfo, DataEncoding) Method

Embeds binary data in a "data" URL (RFC 2397).

Definition

Namespace: FolkerKinzel.DataUrls
Assembly: FolkerKinzel.DataUrls (in FolkerKinzel.DataUrls.dll) Version: 1.0.0+b1c843815044ca6fd87a144c9ff16386002c6473
C#
public static string FromBytes(
	IEnumerable<byte>? bytes,
	 in MimeTypeInfo mimeType,
	DataEncoding encoding = DataEncoding.Base64
)

Parameters

bytes  IEnumerableByte
The binary data to embed in the "data" URL, or null.
mimeType  MimeTypeInfo
The MimeType of the bytes.
encoding  DataEncoding  (Optional)
The encoding to use to embed the bytes.

Return Value

String
A "data" URL, into which the binary data provided by the parameter bytes is embedded.

Exceptions

ArgumentExceptionmimeType is an empty struct.

See Also