Simplify MemoryStream.cpp