BitsetsNET.BitsetContainer.Serialize C# (CSharp) Method

Serialize() public method

Serialize this container in a binary format.
The format of the serialization is the cardinality of this container as a 32-bit integer, followed by the bit array. The cardinality is used in deserialization to distinguish BitsetContainers from ArrayContainers.
public Serialize ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter The writer to which to serialize this container.
return void
        public override void Serialize(BinaryWriter writer)
        {
            writer.Write(Cardinality);
            foreach(long value in Bitmap)
            {
                writer.Write(value);
            }
        }