ArduinoJson: F.A.Q

Can I parse data from a stream?


Since ArduinoJson 5.8, parseArray() and parseObject() accept Arduino’s Stream and std::istream as input:

JsonObject& root = jsonObject.parseObject(myStream);

Parts of the input need to be copied into the JsonBuffer, so you need to increase its capacity accordingly (the Assistant gives the required size).

The parser only copies the relevant part of the input, skipping the spaces and the punctuation. This is way more efficient than copying the whole input in a char[] and then call parseObject().


Fork me on GitHub