示例#1
0
文件: Column.cs 项目: mo5h/omeo
        internal BLOB(Table table, Stream source)
        {
            _table = table;
            _bfs   = table.Database.BlobFS;
            int handle;

            _bfs.Lock();
            try
            {
                Stream stream = _bfs.AllocFile(out handle).BaseStream;
                _id = handle.ToString();
                SetStream(source, stream);
            }
            finally
            {
                _bfs.UnLock();
            }
        }
示例#2
0
        public void AddSingleFile()
        {
            const int    count = 100000;
            int          handle;
            BinaryWriter file = _bfs.AllocFile(out handle);

            Assert.IsTrue(handle > 0);
            for (int i = 0; i < count; ++i)
            {
                file.Write(i.ToString());
            }
            _bfs.Dispose();
            _bfs = null;
            Assert.IsTrue(new FileInfo(_bfsFile).Length > count * 2);
        }