Table of Contents

Class StringFactory

Namespace
Cuemon
Assembly
Cuemon.Core.dll

Provides access to factory methods for creating encoded string representations.

public static class StringFactory
Inheritance
StringFactory

Methods

CreateBinaryDigits(byte[])

Creates a binary digit string representation of the specified byte array.

public static string CreateBinaryDigits(byte[] value)

Parameters

value byte[]

The byte array to convert.

Returns

string

A binary digit string representation of value.

Exceptions

ArgumentNullException

value is null.

CreateHexadecimal(byte[])

Creates a hexadecimal string representation of the specified byte array.

public static string CreateHexadecimal(byte[] value)

Parameters

value byte[]

The byte array to convert.

Returns

string

A hexadecimal string representation of value.

Exceptions

ArgumentNullException

value is null.

CreateHexadecimal(string, Action<EncodingOptions>)

Creates a hexadecimal string representation of the specified string.

public static string CreateHexadecimal(string value, Action<EncodingOptions> setup = null)

Parameters

value string

The string to convert.

setup Action<EncodingOptions>

The delegate that configures the encoding behavior.

Returns

string

A hexadecimal string representation of value.

Exceptions

ArgumentNullException

value is null.

InvalidEnumArgumentException

setup configures an invalid value for Preamble.

CreateProtocolRelativeUrl(Uri, Action<ProtocolRelativeUriStringOptions>)

Creates a protocol-relative URL string representation of the specified Uri.

public static string CreateProtocolRelativeUrl(Uri value, Action<ProtocolRelativeUriStringOptions> setup = null)

Parameters

value Uri

The URI to convert.

setup Action<ProtocolRelativeUriStringOptions>

The delegate that configures the protocol-relative URL format.

Returns

string

A protocol-relative URL string representation of value.

Exceptions

ArgumentNullException

value is null.

ArgumentException

value is not an absolute URI.

CreateUriScheme(UriScheme)

Creates the string representation of the specified UriScheme.

public static string CreateUriScheme(UriScheme value)

Parameters

value UriScheme

The URI scheme to convert.

Returns

string

The string representation of value.

Remarks

Returns the string representation of Undefined when value is not found in the lookup table.

CreateUrlEncodedBase64(byte[])

Creates a URL-safe Base64 string representation of the specified byte array.

public static string CreateUrlEncodedBase64(byte[] value)

Parameters

value byte[]

The byte array to convert.

Returns

string

A URL-safe Base64 string representation of value.

Remarks

This method uses the Base64 URL encoding convention by removing padding characters and replacing + with - and / with _.

The implementation was inspired by Appendix C of the JSON Web Signature (JWS) draft specification.

Exceptions

ArgumentNullException

value is null.