Пример #1
0
        public void Put(CachedImageResult cachedImage, byte[] buffer)
        {
            if (PreparePut(cachedImage, buffer))
            {
                var path = BuildPath(cachedImage.Path);

                if (cachedImage.Extension == "svg")
                {
                    _fileSystem.WriteAllText(path, Encoding.UTF8.GetString(buffer));
                }
                else
                {
                    _fileSystem.WriteAllBytes(path, buffer);
                }

                cachedImage.Exists = true;
                cachedImage.File   = _fileSystem.GetFile(path);
            }
        }