BinaryRage.Storage.GetFromStorage C# (CSharp) Метод

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

public static GetFromStorage ( string key, string filelocation ) : byte[]
key string
filelocation string
Результат byte[]
        public static byte[] GetFromStorage(string key, string filelocation)
        {
            return File.ReadAllBytes(GetExactFileLocation(key, filelocation));
        }

Usage Example

Пример #1
0
        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);
        }