https://zoheirsoftware.com/blog/memorystream-in-csharp