Table of Contents

Class PassthroughSerializer

Namespace
Azure.Iot.Operations.Services.StateStore
Assembly
Azure.Iot.Operations.Services.dll
public class PassthroughSerializer : IPayloadSerializer
Inheritance
PassthroughSerializer
Implements
Inherited Members

Fields

ContentType

public const string ContentType = "application/octet-stream"

Field Value

string

PayloadFormatIndicator

public const MqttPayloadFormatIndicator PayloadFormatIndicator = Unspecified

Field Value

MqttPayloadFormatIndicator

Methods

FromBytes<T>(ReadOnlySequence<byte>, string?, MqttPayloadFormatIndicator)

Deserialize the provided payload.

public T FromBytes<T>(ReadOnlySequence<byte> payload, string? contentType, MqttPayloadFormatIndicator payloadFormatIndicator) where T : class

Parameters

payload ReadOnlySequence<byte>

The byte array to deserialize.

contentType string

The content type of the MQTT message received with this payload.

payloadFormatIndicator MqttPayloadFormatIndicator

The payload format indicator of the MQTT message received with this payload.

Returns

T

The deserialized object.

Type Parameters

T

The type to deserialize into.

ToBytes<T>(T?)

Serialize the provided object.

public SerializedPayloadContext ToBytes<T>(T? payload) where T : class

Parameters

payload T

The object to serialize

Returns

SerializedPayloadContext

The serialized payload in a byte[] and the content type + payload format indicator used when serializing.

Type Parameters

T

The type to serialize