public BTHDataEntry(HNDataDTO data, int offset, BTH tree) { Key = data.Data.RangeSubset(offset, (int)tree.Header.KeySize); //Key = bytes.Skip(offset).Take((int)tree.Header.KeySize).ToArray(); Data = data.Data.RangeSubset(offset + (int)tree.Header.KeySize, (int)tree.Header.DataSize); DataOffset = (ulong)offset + tree.Header.KeySize; ParentTree = tree; }
public BTHDataEntry(HNDataDTO data, int offset, BTH tree) { this.Key = data.Data.RangeSubset(offset, (int) tree.Header.KeySize); //this.Key = bytes.Skip(offset).Take((int)tree.Header.KeySize).ToArray(); var temp = offset + (int) tree.Header.KeySize; this.Data = data.Data.RangeSubset(temp, (int)tree.Header.DataSize); this.DataOffset = (ulong) offset + tree.Header.KeySize; this.ParentTree = tree; }
public BTHHEADER(HNDataDTO block) { var bytes = block.Data; this.BType = bytes[0]; this.KeySize = bytes[1]; this.DataSize = bytes[2]; this.NumLevels = bytes[3]; this.BTreeRoot = new HID(bytes.RangeSubset(4, 4)); }
public BTHDataNode(HID hid, BTH tree) { this.Tree = tree; var bytes = tree.GetHIDBytes(hid); this._data = bytes; this.DataEntries = new List<BTHDataEntry>(); for(int i= 0;i < bytes.Data.Length;i+= (int)(tree.Header.KeySize+tree.Header.DataSize)) this.DataEntries.Add(new BTHDataEntry(bytes, i, tree)); }
public BTHHEADER(HNDataDTO block) { var bytes = block.Data; BType = bytes[0]; KeySize = bytes[1]; DataSize = bytes[2]; NumLevels = bytes[3]; BTreeRoot = new HID(bytes.RangeSubset(4, 4)); }
public BTHDataNode(HID hid, BTH tree) { this.Tree = tree; var bytes = tree.GetHIDBytes(hid); this._data = bytes; this.DataEntries = new List <BTHDataEntry>(); for (int i = 0; i < bytes.Data.Length; i += (int)(tree.Header.KeySize + tree.Header.DataSize)) { this.DataEntries.Add(new BTHDataEntry(bytes, i, tree)); } }