Save to the given Stream instead of creating several MemoryStreams

(Slightly reduces Memory usage, although it's still way too high)