public void TestSerialization() { using (var rb1 = new RoaringBitmap()) { rb1.AddMany(1, 2, 3, 4, 5, 100, 1000); rb1.Optimize(); var s1 = rb1.Serialize(SerializationFormat.Normal); var s2 = rb1.Serialize(SerializationFormat.Portable); using (var rb2 = RoaringBitmap.Deserialize(s1, SerializationFormat.Normal)) using (var rb3 = RoaringBitmap.Deserialize(s2, SerializationFormat.Portable)) { Assert.True(rb1.Equals(rb2)); Assert.True(rb1.Equals(rb3)); } } }
public override bool Equals(object obj) { return(obj is BitVectorRoaringBitmap other && Count.Equals(other.Count) && _roaringBitmap.Equals(other._roaringBitmap)); }