used string writer rather than output stream in json util