removed unnecessary seek on the memory stream before making an array copy of it.