Esempio n. 1
0
        public Task UploadFileChunk(string containerName, FileChunk fileChunk)
        {
            var container = files[containerName];

            InMemoryFileInfo fileInfo;

            if (!container.TryGetValue(fileChunk.FullFileName, out fileInfo))
            {
                fileInfo = new InMemoryFileInfo();
                container.TryAdd(fileChunk.FullFileName, fileInfo);
            }
            fileInfo.Content.Write(fileChunk.Chunk, 0, fileChunk.Chunk.Length);
            return(Task.FromResult(true));
        }
Esempio n. 2
0
        public Task UploadFile(string containerName, string fileName, byte[] fileContent)
        {
            var container = files[containerName];

            InMemoryFileInfo fileInfo;
            if (!container.TryGetValue(fileName, out fileInfo))
            {
                fileInfo = new InMemoryFileInfo();
                container.TryAdd(fileName, fileInfo);
            }
            fileInfo.Content.Write(fileContent, 0, fileContent.Length);
            return Task.FromResult(true);
        }