Class BinaryMessageDeserializer<TModel>
- Namespace
- Silverback.Messaging.BinaryMessages
- Assembly
- Silverback.Integration.dll
Wraps the consumed bytes stream into an instance of TModel.
public sealed class BinaryMessageDeserializer<TModel> : IMessageDeserializer, IEquatable<BinaryMessageDeserializer<TModel>> where TModel : IBinaryMessage, new()
Type Parameters
TModelThe type of the IBinaryMessage implementation.
- Inheritance
-
BinaryMessageDeserializer<TModel>
- Implements
-
IEquatable<BinaryMessageDeserializer<TModel>>
- Inherited Members
Constructors
BinaryMessageDeserializer()
public BinaryMessageDeserializer()
Properties
RequireHeaders
Gets a value indicating whether this serializer (with the current configuration) needs the headers support to work properly.
public bool RequireHeaders { get; }
Property Value
Methods
DeserializeAsync(Stream?, MessageHeaderCollection, ConsumerEndpoint)
Deserializes the byte array into a message object.
public ValueTask<DeserializedMessage> DeserializeAsync(Stream? messageStream, MessageHeaderCollection headers, ConsumerEndpoint endpoint)
Parameters
messageStreamStreamThe Stream containing the message to be deserialized.
headersMessageHeaderCollectionThe message headers collection.
endpointConsumerEndpointThe endpoint.
Returns
- ValueTask<DeserializedMessage>
A ValueTask<TResult> representing the asynchronous operation. The task result contains the deserialized message (or
nullwhen the input is null or empty) and the type of the message.
Equals(BinaryMessageDeserializer<TModel>?)
public bool Equals(BinaryMessageDeserializer<TModel>? other)
Parameters
otherBinaryMessageDeserializer<TModel>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetCompatibleSerializer()
Gets a new IMessageSerializer compatible with this deserializer.
public IMessageSerializer GetCompatibleSerializer()
Returns
- IMessageSerializer
A new instance of an IMessageSerializer compatible with this deserializer.
GetHashCode()
public override int GetHashCode()