Serialize() public method

Serialize the roaring array into a binary format.
public Serialize ( BinaryWriter writer ) : void
writer BinaryWriter The writer to write the serialization to.
return void
Example #1
0
 /// <summary>
 /// Write a binary serialization of this roaring bitset.
 /// </summary>
 /// <param name="stream">The stream to write to.</param>
 public void Serialize(Stream stream)
 {
     //We don't care about the encoding, but we have to specify something to be able to set the stream as leave open.
     using (BinaryWriter writer = new BinaryWriter(stream, Encoding.Default, true))
     {
         containers.Serialize(writer);
     }
 }