public void StoreWriteRead() { SectorIndex index = new SectorIndex(3); _store.Initialize(); // manually make a sector var sector = new Sector(_sectorSize); var rnd = new Random(42); var contentBytes = new byte[sector.Contents.Length]; rnd.NextBytes(contentBytes); contentBytes.AsSpan().CopyTo(sector.Contents); _store.AllocateSectors(4); _store.Write(index, sector); var storeProvided = _store.Read(index); Assert.True(storeProvided.Contents.SequenceEqual(contentBytes.AsSpan())); }
/// <param name="config"></param> /// <param name="lineage"></param> /// <param name="store"></param> /// <param name="subTable"></param> public SozuTable(SozuConfig config, ILineage lineage, ISectorStore store, SozuTable subTable = null) { _config = config; _lineage = lineage; _store = store; _subTable = subTable; _residue = TxoPack.Create(); _rangeOutputs = TxoPack.Create(); _deserialized = TxoPack.Create(); _complement = TxoPack.Create(); _kept = TxoPack.Create(); _flowDown = TxoPack.Create(); _merged = TxoPack.Create(2); store.Initialize(); if (config.ImplicitSectors && !store.HasSectors()) { store.AllocateSectors(1 << config.SectorBitDepth); EnsurePersistence(); } }