Exemple #1
0
        /// <summary>
        /// 更新文件内容
        /// </summary>
        internal void UpdateBody(RedisFileBody body)
        {
            var db = RedisConnectionFactory.GetDatabase();

            db.StringSet(FileKeyPrefix + FullPath, JsonConvert.SerializeObject(body));
            Body = body;
        }
Exemple #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        public RedisFileStream(RedisFileEntry entry, RedisFileBody body)
        {
            Entry = entry;
            Body  = body;
            var contents = body.GetContents();

            Write(contents, 0, contents.Length);
            Seek(0, SeekOrigin.Begin);
        }