示例#1
0
文件: Column.cs 项目: mo5h/omeo
 public void Set(Stream source)
 {
     _bfs.Lock();
     try
     {
         int handle = Handle;
         using (Stream target = _bfs.RewriteFile(handle).BaseStream)
         {
             SetStream(source, target);
         }
         _bfs.Flush();
     }
     finally
     {
         _bfs.UnLock();
     }
 }
示例#2
0
文件: Column.cs 项目: mo5h/omeo
 public override void Close()
 {
     if (_dirty)
     {
         _bfs.Lock();
         int handle = _handle;
         try
         {
             using (Stream stream = _bfs.RewriteFile(handle).BaseStream)
             {
                 WriteTo(stream);
             }
             _bfs.Flush();
         }
         finally
         {
             _bfs.UnLock();
         }
     }
     base.Close();
 }
示例#3
0
文件: Column.cs 项目: mo5h/omeo
 public BlobFSMemoryStream(int handle, BlobFileSystem bfs)
     : base(1024)
 {
     _handle = handle;
     _bfs    = bfs;
     bfs.Lock();
     try
     {
         CopyStream(this, bfs.GetRawStream(handle), bfs.GetRawBytes());
     }
     catch
     {
         SetLength(0);
         bfs.RewriteFile(handle);
         bfs.Flush();
     }
     finally
     {
         bfs.UnLock();
     }
     base.Position = 0;
     _dirty        = false;
 }