Change from assertion to exception when a MemoryStream reaches its size limit.