Class FeatureSetSerializer
- Namespace
- NLightning.Infrastructure.Serialization.Node
- Assembly
- NLightning.Infrastructure.Serialization.dll
public class FeatureSetSerializer : IFeatureSetSerializer
- Inheritance
-
FeatureSetSerializer
- Implements
- Inherited Members
Methods
DeserializeAsync(Stream, bool)
Deserializes the features from a binary reader.
public Task<FeatureSet> DeserializeAsync(Stream stream, bool includeLength = true)
Parameters
stream
StreamThe stream to read from.
includeLength
boolIf the length of the byte array is included.
Returns
- Task<FeatureSet>
The deserialized features.
Remarks
If the length of the byte array is included, the first 2 bytes are read as the length of the byte array.
Exceptions
- SerializationException
Error deserializing Features
SerializeAsync(FeatureSet, Stream, bool, bool)
Serializes the features to a binary writer.
public Task SerializeAsync(FeatureSet featureSet, Stream stream, bool asGlobal = false, bool includeLength = true)
Parameters
featureSet
FeatureSetThe features to serialize.
stream
StreamThe stream to write to.
asGlobal
boolIf the features should be serialized as a global feature set.
includeLength
boolIf the length of the byte array should be included.
Returns
Remarks
If the features are serialized as a global feature set, only the first 13 bits are serialized.