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
PayloadFormatIndicator
public const MqttPayloadFormatIndicator PayloadFormatIndicator = Unspecified
Field Value
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
payloadReadOnlySequence<byte>The byte array to deserialize.
contentTypestringThe content type of the MQTT message received with this payload.
payloadFormatIndicatorMqttPayloadFormatIndicatorThe payload format indicator of the MQTT message received with this payload.
Returns
- T
The deserialized object.
Type Parameters
TThe type to deserialize into.
ToBytes<T>(T?)
Serialize the provided object.
public SerializedPayloadContext ToBytes<T>(T? payload) where T : class
Parameters
payloadTThe object to serialize
Returns
- SerializedPayloadContext
The serialized payload in a byte[] and the content type + payload format indicator used when serializing.
Type Parameters
TThe type to serialize