Ejemplo n.º 1
0
            public void Load(WTree tree, BinaryReader reader)
            {
                int count = (int)CountCompression.Deserialize(reader);

                Capacity = count;

                NodeType nodeType = (NodeType)reader.ReadByte();

                for (int i = 0; i < count; i++)
                {
                    //read locator
                    var path    = tree.Deserialize(reader);
                    var key     = path.PersistKey.Read(reader);
                    var locator = new FullKey(path, key);

                    //read branch info
                    long      nodeID    = reader.ReadInt64();
                    NodeState nodeState = (NodeState)reader.ReadInt32();

                    Branch branch = new Branch(tree, nodeType, nodeID);
                    branch.NodeState = nodeState;

                    branch.Cache.Load(tree, reader);

                    Add(new KeyValuePair <FullKey, Branch>(locator, branch));
                }
            }
Ejemplo n.º 2
0
            public void Load(WTree tree, BinaryReader reader)
            {
                int count = reader.ReadInt32();

                if (count == 0)
                {
                    return;
                }

                for (int i = 0; i < count; i++)
                {
                    //read locator
                    var locator = tree.Deserialize(reader);

                    //read operations
                    var operations = locator.PersistOperations.Read(reader);

                    Add(locator, operations);
                }
            }