Write the JSON to the provided Writer. The writer will be flushed but not closed.
the Writer to receive the JSON
on IO error