DataUrlFromBytes(ReadOnlySpanByte, String, 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(
	ReadOnlySpan<byte> bytes,
	string? mimeType = "application/octet-stream",
	DataEncoding encoding = DataEncoding.Base64
)

Parameters

bytes  ReadOnlySpanByte
The binary data to embed in the "data" URL.
mimeType  String  (Optional)
The Internet Media Type of the bytes, or null for OctetStream.
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.

See Also