public Guid AddFile(byte[] contents, string mimeType) { Guid id = Guid.NewGuid(); SimpleFile file = new SimpleFile(contents, mimeType); _files.Add(id, file); return id; }
public byte[] ReadFile(Guid id, out string mimeType) { SimpleFile file = _files[id]; mimeType = file.MimeType; return(file.Contents); }
public Guid AddFile(byte[] contents, string mimeType) { Guid id = Guid.NewGuid(); SimpleFile file = new SimpleFile(contents, mimeType); _files.Add(id, file); return(id); }
public void ReadFile(Guid id, string fileName) { SimpleFile file = _files[id]; File.WriteAllBytes(fileName, file.Contents); }