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); }
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); } }