Ejemplo n.º 1
0
        /// <summary>
        /// 创建B+树
        /// </summary>
        /// <param name="treeFileStream">指定树文件的文件流</param>
        /// <param name="blockFileStream">指定块文件的文件流</param>
        /// <param name="keyLength">树允许的键的长度</param>
        /// <param name="nodeCapacity">树允许的各子节点的最大容量</param>
        /// <param name="blockSize">块大小</param>
        /// <returns>B+树</returns>
        public static BPlusTreeBytes Create(Stream treeFileStream, Stream blockFileStream, int keyLength, int nodeCapacity, int blockSize)
        {
            BPlusTreeLong tree    = BPlusTreeLong.InitializeInStream(treeFileStream, (long)0, keyLength, nodeCapacity);
            LinkedFile    archive = LinkedFile.InitializeInStream(blockFileStream, (long)0, blockSize);

            return(new BPlusTreeBytes(tree, archive));
        }