Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

HtmlDataUri

OfficeIMO.Html

Namespace
OfficeIMO.Html
Assembly
OfficeIMO.Html
Source revision
be6c300e4ab1 with working tree changes
Modifiers
sealed

Media-neutral data URI with bounded-size inspection and byte decoding.

Inheritance

  • object
  • HtmlDataUri

Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 1

Methods

public byte[] DecodeBytes() #

Decodes the payload as bytes.

Returns

byte[]
public string DecodeText(IHtmlEncodingProvider? encodingProvider = null) #

Decodes the payload using its declared charset, or UTF-8 when no charset is declared.

Parameters

encodingProvider OfficeIMO.Html.Dom.IHtmlEncodingProvider? = null optional

Returns

string
public long EstimateDecodedByteCount() #

Calculates decoded byte count without allocating the decoded payload.

Returns

long
public bool TryDecodeBytes(out byte[] bytes) #

Attempts to decode the payload as bytes.

Parameters

bytes byte[] required

Returns

bool
public bool TryDecodeText(out string text, IHtmlEncodingProvider? encodingProvider = null) #

Attempts to decode the payload using its declared charset, or UTF-8 when none is declared.

Parameters

text string required
encodingProvider OfficeIMO.Html.Dom.IHtmlEncodingProvider? = null optional

Returns

bool
public bool TryEstimateDecodedByteCount(out long byteCount) #

Attempts to calculate decoded byte count without allocating the decoded payload.

Parameters

byteCount long required

Returns

bool
public static bool TryParse(string? source, out HtmlDataUri dataUri) #

Tries to parse a data URI with an explicit media type.

Parameters

source string? required
dataUri OfficeIMO.Html.HtmlDataUri required

Returns

bool

Properties

public string Metadata { get; } #

Metadata without the leading data: prefix.

public string MediaType { get; } #

Declared media type.

public string Data { get; } #

Raw payload after the comma separator.

public bool IsBase64 { get; } #

Whether the payload uses base64 encoding.