public void TestWAHBitArray3() { var b = new WAHBitArray(); int count = 25; for (int i = 0; i < 5; i++) { b.Set(i, false); } for (int i = 5; i < count + 5; i++) { b.Set(i, true); } for (int i = 30; i < 64; i++) { b.Set(i, i == 35); } for (int i = 64; i < 65; i++) { b.Set(i, true); } var expected = b.GetBitIndexes().ToArray(); var b2 = new WAHBitArray(WAHBitArray.TYPE.Compressed_WAH, b.GetCompressed()); var actual = b2.GetBitIndexes().ToArray(); expected.Should(Be.EqualTo(actual), "expected.Should(Be.EqualTo(actual))"); }
public void TestWAHBitArray1() { var b = new WAHBitArray(); int count = 31; for (int i = 0; i < count; i++) { b.Set(i, true); } var expected = b.GetBitIndexes().ToArray(); var b2 = new WAHBitArray(WAHBitArray.TYPE.Compressed_WAH, b.GetCompressed()); var actual = b2.GetBitIndexes().ToArray(); expected.Should(Be.EqualTo(actual), "expected.Should(Be.EqualTo(actual))"); }
private void WriteDeleted() { using ( FileStream del = new FileStream(_path + _fileName + ".deleted", FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite)) { uint[] b = _deleted.GetCompressed(); foreach (uint i in b) { del.Write(Helper.GetBytes((int)i, false), 0, 4); } del.Flush(); del.Close(); } }
public uint[] GetCompressedBits() { return(_bits != null?_bits.GetCompressed() : null); }