Class TlvSerializer
- Namespace
- NLightning.Infrastructure.Serialization.Tlv
- Assembly
- NLightning.Infrastructure.Serialization.dll
public class TlvSerializer : ITlvSerializer
- Inheritance
-
TlvSerializer
- Implements
- Inherited Members
Constructors
TlvSerializer(IValueObjectSerializerFactory)
public TlvSerializer(IValueObjectSerializerFactory valueObjectSerializerFactory)
Parameters
valueObjectSerializerFactory
IValueObjectSerializerFactory
Methods
DeserializeAsync(Stream)
Deserializes a BaseTlv value from a stream.
public Task<BaseTlv?> DeserializeAsync(Stream stream)
Parameters
stream
StreamThe stream from which the BaseTlv value will be deserialized.
Returns
- Task<BaseTlv>
A task that represents the asynchronous deserialization operation, containing the deserialized BaseTlv value.
Exceptions
- ArgumentException
Thrown when the stream is empty or contains insufficient data for deserialization.
- IOException
Thrown when an I/O error occurs during the read operation.
SerializeAsync(BaseTlv, Stream)
Serializes a BaseTlv value into a stream.
public Task SerializeAsync(BaseTlv baseTlv, Stream stream)
Parameters
baseTlv
BaseTlvThe BaseTlv value to serialize.
stream
StreamThe stream where the serialized value will be written.
Returns
- Task
A task that represents the asynchronous serialization operation.
Exceptions
- ArgumentNullException
Thrown when the stream is null.
- IOException
Thrown when an I/O error occurs during the write operation.