MemoryTributary is a MemoryStream replacement using multiple memory segments to store the content of the stream, as opposed to the single byte array of MemoryStream. It is designed to be a complete replacement, capable of handling the large datasets that MemoryStream
Why use MemoryTributary?
contains a full explanation of the issue that MemoryTributary is attempting to solve, but in summary:
Getting & Using MemoryTributary
- MemoryTributary makes more efficient use of available address space, allowing for larger streams.
- MemoryTributary never has to re-allocate or copy memory, making it more efficient when writing.
MemoryTributary derives from Stream and can be used anywhere a Stream can.
The source consists of just one file (get this from Source Code), MemoryTributary.cs: copy this into your project, compile and go!