Sunday, March 26, 2017

FMod - No more ArrayStream

Apparently when I wrote the first version of Abiathar, I didn't know that the MemoryStream class is perfectly capable of being initialized from a byte array. Abiathar has - almost from the very beginning - had an ArrayStream class that wraps a byte array so I can use embedded resources with the same interface as files. The disadvantage is that my code is almost certainly not as optimized as the Framework's (especially in the memory consumption area), so there's absolutely no reason to not be using MemoryStream.

So today, I deleted the ArrayStream class and replaced all uses of it with MemoryStream. Everything works perfectly fine.

No comments:

Post a Comment