Generates a JSON data stream from this and returns it as a buffer.
a generator
return location for the length of the returned buffer
a newly allocated string holding a JSON data stream