示例#1
0
文件: DB.cs 项目: schaelle/BinaryRage
        static public T Get(string key, string filelocation)
        {
            //Try getting the object from cache first
            if (!Cache.CacheDic.IsEmpty)
            {
                SimpleObject simpleObjectFromCache;
                if (Cache.CacheDic.TryGetValue(filelocation + key, out simpleObjectFromCache))
                {
                    return((T)simpleObjectFromCache.Value);
                }
            }

            byte[] compressGZipData   = Compress.DecompressGZip(Storage.GetFromStorage(key, filelocation));
            T      umcompressedObject = (T)ConvertHelper.ByteArrayToObject(compressGZipData);

            return(umcompressedObject);
        }