Consumes nBytes
bytes from the stream, interprets the bytes as a utf-8 string and the string as a valid JSON object.
Equations
- IO.FS.Stream.readJson h nBytes = do let bytes ← IO.FS.Stream.read h (USize.ofNat nBytes) let s : String := String.fromUTF8Unchecked bytes IO.ofExcept (Lean.Json.parse s)
Instances For
Equations
- IO.FS.Stream.writeJson h j = do IO.FS.Stream.putStr h (Lean.Json.compress j) h.flush