private void TBit(BitMap4 map, int bit) { map.SetTrue(bit); Assert.IsTrue(map.IsTrue(bit)); map.SetFalse(bit); Assert.IsFalse(map.IsTrue(bit)); map.SetTrue(bit); Assert.IsTrue(map.IsTrue(bit)); }
protected override void WriteElements(IWriteContext context, object obj, ArrayInfo info) { var objects = AllElements(Container(context), obj); if (HasNullBitmap(info)) { var nullBitMap = new BitMap4(info.ElementCount()); var nullBitMapBuffer = context.Reserve(nullBitMap.MarshalledLength()); var currentElement = 0; while (objects.MoveNext()) { var current = objects.Current; if (current == null) { nullBitMap.SetTrue(currentElement); } else { context.WriteObject(DelegateTypeHandler(), current); } currentElement++; } nullBitMapBuffer.WriteBytes(nullBitMap.Bytes()); } else { while (objects.MoveNext()) { context.WriteObject(DelegateTypeHandler(), objects.Current); } } }