Code Monkey home page Code Monkey logo

Comments (8)

bblanchon avatar bblanchon commented on May 25, 2024

Hi @liamw9534,

Did you read How to deserialize a very large document?

Best regards,
Benoit

from arduinojson.

liamw9534 avatar liamw9534 commented on May 25, 2024

from arduinojson.

bblanchon avatar bblanchon commented on May 25, 2024

I'm unsure which library you're referring to, but most Arduino file abstractions implement the Stream interface. Examples include SD, ESP32 FS, ESP8266 FS, Arduino Audio Tools, RasPi Bridge.

If the Stream interface is not supported, you can write a custom reader.
You can find an example for the C files API (stdio.h) in Mastering ArduinoJson in the Advanced Techniques chapter.

from arduinojson.

liamw9534 avatar liamw9534 commented on May 25, 2024

from arduinojson.

bblanchon avatar bblanchon commented on May 25, 2024

Assuming you're talking about the SdFat library, it does support the Stream abstraction, even if it's not very explicit.
Let me explain:

  1. File is a typedef for File32, ExFile, or FsFile
  2. Let's take File32 for example; it derives from StreamFile
  3. StreamFile derives from stream_t
  4. stream_t is a typedef for Stream

Conclusion: File32 implements the Stream interface, and so do ExFile and FsFile.
Therefore, you can pass the file instance directly to deserializeJson().

from arduinojson.

liamw9534 avatar liamw9534 commented on May 25, 2024

from arduinojson.

liamw9534 avatar liamw9534 commented on May 25, 2024

from arduinojson.

bblanchon avatar bblanchon commented on May 25, 2024

You're welcome, @liamw9534.
Thank you for using ArduinoJson!
Don't forget to cast a star to support the project 😉

from arduinojson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.