DataUrlAppendBytesTo(StringBuilder, ReadOnlySpanByte, String, DataEncoding) Method

Appends binary data as "data" URL (RFC 2397) to the end of a StringBuilder.

Definition

Namespace: FolkerKinzel.DataUrls
Assembly: FolkerKinzel.DataUrls (in FolkerKinzel.DataUrls.dll) Version: 1.0.0+b1c843815044ca6fd87a144c9ff16386002c6473
C#
public static StringBuilder AppendBytesTo(
	StringBuilder builder,
	ReadOnlySpan<byte> bytes,
	string? mimeType = "application/octet-stream",
	DataEncoding encoding = DataEncoding.Base64
)

Parameters

builder  StringBuilder
The StringBuilder to which a "data" URL is appended.
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

StringBuilder
A reference to builder.

Exceptions

ArgumentNullExceptionbuilder is null.

See Also