You can use
JSONStreamWriter to write JSON directly to a
Stream that implements the
You can use this technique to write JSON directly to a
TCPClient for example, without buffering in RAM. This is useful for very large objects, however it's generally more efficient to buffer reasonably-sized objects in RAM and write them in a single
write() instead of byte-by-byte.
// PROTOTYPE JSONStreamWriter(Print &stream);
JSONWriter that writes to a
JSONStreamWriter::stream, stream, JSONStreamWriter.stream
// PROTOTYPE Print* stream() const;
Returns the stream you passed to the constructor.