We have a file system abstraction that makes it easy to switch between on-premises and cloud-based (Azure) storage.
For reading and writing files, we have the following elements:
Stream OpenRead(); Stream OpenWrite();
Part of our application βlinksβ documents into a single file. For our local OpenWrite storage OpenWrite , an additional stream is returned:
public Stream OpenWrite() { return new FileStream(fileInfo.FullName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, BufferSize, useAsync: true); }
To store Azure memory, we do the following:
public Stream OpenWrite() { return blob.OpenWrite(); }
Unfortunately, this overrides the contents of the blob each time. Is it possible to return a writable stream that can be added to?
source share