Class ChainHashTypeSerializer
- Assembly
- NLightning.Infrastructure.Serialization.dll
public class ChainHashTypeSerializer : IValueObjectTypeSerializer<ChainHash>, IValueObjectTypeSerializer
- Inheritance
-
ChainHashTypeSerializer
- Implements
- Inherited Members
Methods
DeserializeAsync(Stream)
Deserializes a ChainHash value from a stream.
public Task<ChainHash> DeserializeAsync(Stream stream)
Parameters
stream
StreamThe stream from which the ChainHash value will be deserialized.
Returns
- Task<ChainHash>
A task that represents the asynchronous deserialization operation, containing the deserialized ChainHash 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(IValueObject, Stream)
Serializes a ChainHash value into a stream.
public Task SerializeAsync(IValueObject valueObject, Stream stream)
Parameters
valueObject
IValueObjectThe ChainHash 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.