improve MemoryStream object creation performance
LINT