diff --git a/FAQ.md b/FAQ.md index 89e62de..96129e9 100644 --- a/FAQ.md +++ b/FAQ.md @@ -512,6 +512,26 @@ See: ### Can I parse data from a stream? + +Yes. + +Since ArduinoJson 5.8, `parseArray()` and `parseObject()` accept Arduino's `Stream` and `std::istream` as input: + +```c++ +JsonObject& root = jsonObject.parseObject(myStream); +``` + +CAUTION: parts of the input need to be copied into the `JsonBuffer`, so you need to increase its capacity accordingly. + +See: + +* [Examples: JsonHttpClient.ino](https://github.com/bblanchon/ArduinoJson/blob/master/examples/JsonHttpClient/JsonHttpClient.ino#L149) +* [API Reference: JsonBuffer::parseArray()](https://github.com/bblanchon/ArduinoJson/wiki/API%20Reference#jsonbufferparsearray) +* [API Reference: JsonBuffer::parseObject()](https://github.com/bblanchon/ArduinoJson/wiki/API%20Reference#jsonbufferparseobject) +* [JsonBuffer size calculator](https://bblanchon.github.io/ArduinoJson/) + + + ### Can I parse a JSON input that is too big to fit in memory? No.