Reimplementing Stream comparison as MemoryStream comparison.