コード例 #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
ファイル: BlobFileSystemTests.cs プロジェクト: mo5h/omeo
        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);
        }