switch MemoryUtil to use MemoryStream