Table of Contents

Class MqttUserProperty

Namespace
Azure.Iot.Operations.Protocol.Models
Assembly
Azure.Iot.Operations.Protocol.dll
public class MqttUserProperty
Inheritance
MqttUserProperty
Inherited Members
Extension Methods

Constructors

MqttUserProperty(string, ArraySegment<byte>)

Creates a new MqttUserProperty with a string name and a pre-encoded UTF-8 byte value. This constructor is more performant when the value is already available as bytes.

public MqttUserProperty(string name, ArraySegment<byte> value)

Parameters

name string

The property name.

value ArraySegment<byte>

The property value as an ArraySegment of bytes. The ArraySegment must have a valid backing array.

Exceptions

ArgumentNullException

Thrown when name is null.

ArgumentException

Thrown when value has a null backing array.

MqttUserProperty(string, ReadOnlyMemory<byte>)

Creates a new MqttUserProperty with a string name and a pre-encoded UTF-8 byte value. This constructor is more performant when the value is already available as bytes.

public MqttUserProperty(string name, ReadOnlyMemory<byte> value)

Parameters

name string

The property name.

value ReadOnlyMemory<byte>

The property value as ReadOnlyMemory of bytes.

Exceptions

ArgumentNullException

Thrown when name is null.

MqttUserProperty(string, string)

Creates a new MqttUserProperty with a string name and string value. The value is internally stored as UTF-8 bytes for performance.

public MqttUserProperty(string name, string value)

Parameters

name string

The property name.

value string

The property value as a string.

Exceptions

ArgumentNullException

Thrown when name or value is null.

Properties

Name

Gets the property name.

public string Name { get; }

Property Value

string

Value

Gets the property value as a string. This decodes the internal byte buffer as UTF-8.

public string Value { get; }

Property Value

string

ValueBuffer

Gets the property value as a ReadOnlyMemory of bytes. This is the most performant way to access the value when passing it through without modification.

public ReadOnlyMemory<byte> ValueBuffer { get; }

Property Value

ReadOnlyMemory<byte>