Hi;
While using a MemoryStream, I find myself often copying (hence duplicating) data to a temporary array of bytes.
I think it's a little bit of a waste of ressource, because MemoryStream dosen't let you directly access the underlying byte array.
In this situation, what's the real advantage of a MemoryStream? I have read somewhere that it acts like a memory-mapped file. Data is brought from disk only on access, consuming less memory.
Is that true? I don't think so. Maybe it's the case for a FileStream?
Thank you for your clarification.