Esempio n. 1
0
        public BTHIndexEntry(byte[] bytes, int offset, BTHHEADER header)
        {
            Key = bytes.RangeSubset(offset, (int)header.KeySize);
            var temp = offset + (int)header.KeySize;

            HID = new HID(bytes.RangeSubset(temp, 4));
        }
Esempio n. 2
0
        public BTH(HN heapNode, HID userRoot = null)
        {
            this.HeapNode = heapNode;

            var bthHeaderHID = userRoot ?? heapNode.HeapNodes[0].Header.UserRoot;

            this.Header = new BTHHEADER(HeapNodeBO.GetHNHIDBytes(heapNode, bthHeaderHID));
            this.Root   = new BTHIndexNode(this.Header.BTreeRoot, this, (int)this.Header.NumLevels);

            this.Properties = new Dictionary <byte[], BTHDataEntry>(new ArrayUtilities.ByteArrayComparer());

            var stack = new Stack <BTHIndexNode>();

            stack.Push(this.Root);
            while (stack.Count > 0)
            {
                var cur = stack.Pop();

                if (cur.Data != null)
                {
                    foreach (var entry in cur.Data.DataEntries)
                    {
                        this.Properties.Add(entry.Key, entry);
                    }
                }

                if (cur.Children != null)
                {
                    foreach (var child in cur.Children)
                    {
                        stack.Push(child);
                    }
                }
            }
        }
Esempio n. 3
0
        public BTH(HN heapNode, HID userRoot = null)
        {
            this.HeapNode = heapNode;

            var bthHeaderHID = userRoot ?? heapNode.HeapNodes[0].Header.UserRoot;
            this.Header = new BTHHEADER(HeapNodeBO.GetHNHIDBytes(heapNode, bthHeaderHID));
            this.Root = new BTHIndexNode(this.Header.BTreeRoot, this, (int)this.Header.NumLevels);

            this.Properties = new Dictionary<byte[], BTHDataEntry>(new ArrayUtilities.ByteArrayComparer());

            var stack = new Stack<BTHIndexNode>();
            stack.Push(this.Root);
            while (stack.Count > 0)
            {
                var cur = stack.Pop();

                if (cur.Data != null)
                    foreach (var entry in cur.Data.DataEntries)
                        this.Properties.Add(entry.Key, entry);

                if (cur.Children != null)
                    foreach (var child in cur.Children)
                        stack.Push(child);

            }
        }
Esempio n. 4
0
        public BTHDataRecord(byte[] bytes, BTHHEADER header)
        {
            var keySize = (int)header.KeySize;
            var dataSize = (int) header.DataSize;

            this.Key = BitConverter.ToUInt16(bytes.Take(keySize).ToArray(), 0);
            this.Value = BitConverter.ToUInt32(bytes.Skip(keySize).Take(dataSize).ToArray(), 0);
        }
Esempio n. 5
0
        public BTHDataRecord(byte[] bytes, BTHHEADER header)
        {
            var keySize  = (int)header.KeySize;
            var dataSize = (int)header.DataSize;

            Key   = BitConverter.ToUInt16(bytes.Take(keySize).ToArray(), 0);
            Value = BitConverter.ToUInt32(bytes.Skip(keySize).Take(dataSize).ToArray(), 0);
        }
Esempio n. 6
0
 public BTHIndexEntry(byte[] bytes, int offset, BTHHEADER header)
 {
     this.Key = bytes.RangeSubset(offset,(int)header.KeySize);
     var temp = offset + (int) header.KeySize;
     this.HID = new HID(bytes.RangeSubset(temp, 4));
 }