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
namestringThe property name.
valueArraySegment<byte>The property value as an ArraySegment of bytes. The ArraySegment must have a valid backing array.
Exceptions
- ArgumentNullException
Thrown when
nameis null.- ArgumentException
Thrown when
valuehas 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
namestringThe property name.
valueReadOnlyMemory<byte>The property value as ReadOnlyMemory of bytes.
Exceptions
- ArgumentNullException
Thrown when
nameis 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
Exceptions
- ArgumentNullException
Thrown when
nameorvalueis null.
Properties
Name
Gets the property name.
public string Name { get; }
Property Value
Value
Gets the property value as a string. This decodes the internal byte buffer as UTF-8.
public string Value { get; }
Property Value
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; }