コード例 #1
0
ファイル: STSdb.cs プロジェクト: zhouweiaccp/code
        public static IStorageEngine FromFile(string systemFileName, string dataFileName, bool useCompression = false)
        {
            var  system          = new OptimizedFileStream(systemFileName, FileMode.OpenOrCreate);
            var  data            = new OptimizedFileStream(dataFileName, FileMode.OpenOrCreate);
            long initialFreeSize = IOUtils.GetTotalSpace(Path.GetPathRoot(Path.GetFullPath(dataFileName)));

            return(STSdb.FromStream(system, data, initialFreeSize, useCompression));
        }
コード例 #2
0
ファイル: STSdb.cs プロジェクト: zhouweiaccp/code
        public static IStorageEngine FromMemory(bool useCompression = false)
        {
            var system = new MemoryStream();
            var data   = new MemoryStream();

            long initialFreeSize = 0;

            ManagementObjectSearcher searcher = new ManagementObjectSearcher(new ObjectQuery("SELECT * From Win32_ComputerSystem"));

            foreach (var item in searcher.Get())
            {
                initialFreeSize = long.Parse(item["TotalPhysicalMemory"].ToString());
            }

            return(STSdb.FromStream(system, data, initialFreeSize, useCompression));
        }
コード例 #3
0
        public static IStorageEngine FromFile(string fileName, bool useCompression = false, AllocationStrategy strategy = AllocationStrategy.FromTheCurrentBlock)
        {
            var stream = new OptimizedFileStream(fileName, FileMode.OpenOrCreate);

            return(STSdb.FromStream(stream, useCompression, strategy));
        }
コード例 #4
0
        public static IStorageEngine FromMemory(bool useCompression = false, AllocationStrategy strategy = AllocationStrategy.FromTheCurrentBlock)
        {
            var stream = new MemoryStream();

            return(STSdb.FromStream(stream, useCompression, strategy));
        }
コード例 #5
0
ファイル: STSdb.cs プロジェクト: yuuhhe/STSdb4
        public static IStorageEngine FromFile(string fileName)
        {
            var stream = new OptimizedFileStream(fileName, FileMode.OpenOrCreate);

            return(STSdb.FromStream(stream));
        }