示例#1
0
        protected CacheManifest GetCachedManifestLocked(DataHash commonkey)
        {
            CacheManifest manifest = null;

            if (outputCache.ContainsEntry(commonkey.SessionHash, F_Manifest))
            {
                using (var mfs = outputCache.OpenFileStream(commonkey.SessionHash, F_Manifest, FileMode.Open, FileAccess.Read))
                {
                    manifest = CacheManifest.Deserialize(mfs);
                }
            }

            return(manifest);
        }
示例#2
0
 public long ReadStat(string statfile)
 {
     try
     {
         cache.EnsureKey(K_Stats);
         using (var stats = cache.OpenFileStream(K_Stats, statfile, FileMode.Open, FileAccess.Read))
         {
             using (var sr = new StreamReader(stats))
             {
                 var x = sr.ReadToEnd();
                 return(Int64.Parse(x));
             }
         }
     }
     catch
     {
         return(0);
     }
 }