예제 #1
0
        public Aes128CtrExStorage(IStorage baseStorage, IStorage bucketTreeData, byte[] key, byte[] counter, bool leaveOpen)
            : base(baseStorage, key, counter, leaveOpen)
        {
            BucketTree = new BucketTree <AesSubsectionEntry>(bucketTreeData);

            SubsectionEntries = BucketTree.GetEntryList();
            SubsectionOffsets = SubsectionEntries.Select(x => x.Offset).ToList();
        }
예제 #2
0
        public IndirectStorage(IStorage bucketTreeData, bool leaveOpen, params IStorage[] sources)
        {
            Sources.AddRange(sources);

            LeaveOpen = leaveOpen;

            BucketTree = new BucketTree <RelocationEntry>(bucketTreeData);

            RelocationEntries = BucketTree.GetEntryList();
            RelocationOffsets = RelocationEntries.Select(x => x.Offset).ToList();

            Length = BucketTree.BucketOffsets.OffsetEnd;
        }
예제 #3
0
            public Result Initialize(BucketTree tree)
            {
                Assert.AssertTrue(tree != null);
                Assert.AssertTrue(Tree == null || tree == Tree);

                if (Entry == null)
                {
                    Entry = ArrayPool <byte> .Shared.Rent((int)tree.EntrySize);

                    Tree       = tree;
                    EntryIndex = -1;
                }

                return(Result.Success);
            }
예제 #4
0
 public static long QueryEntryStorageSize(int entryCount) =>
 BucketTree.QueryEntryStorageSize(NodeSize, Unsafe.SizeOf <Entry>(), entryCount);
예제 #5
0
 public static long QueryHeaderStorageSize() => BucketTree.QueryHeaderStorageSize();