Table of Contents

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 Stream

The stream to read from.

includeLength bool

If 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 FeatureSet

The features to serialize.

stream Stream

The stream to write to.

asGlobal bool

If the features should be serialized as a global feature set.

includeLength bool

If the length of the byte array should be included.

Returns

Task

Remarks

If the features are serialized as a global feature set, only the first 13 bits are serialized.