Aselia.Core.Cache.Load C# (CSharp) Метод

Load() публичный статический Метод

public static Load ( ) : Cache
Результат Cache
        public static Cache Load()
        {
            try
            {
                if (File.Exists)
                {
                    using (FileStream fs = File.OpenRead())
                    using (DeflateStream deflate = new DeflateStream(fs, CompressionMode.Decompress))
                    {
                        return new Cache((CacheSurrogate)Serializer.Deserialize(fs));
                    }
                }
                else
                {
                    return null;
                }
            }
            catch
            {
                return null;
            }
        }

Same methods

Cache::Load ( Stream stream, bool leaveOpen = false ) : Cache

Usage Example

Пример #1
0
        private void OnCache()
        {
            using (MemoryStream mem = new MemoryStream(BodyBuffer))
            {
                Local.Cache = Cache.Load(mem);
            }

            Local.CommitCache();
        }