I can read JSON from a file into a string and then deserialize like so:
val jsonString = new String(Files.readAllBytes(Paths.get("myObject.json")))
val json = parse(jsonString)
val myObject = json.extract[MyClass]
This seems inefficient to me, especially for large files, because I'm reading into a string first and only then passing the string to the deserializer.
Is it possible to deserialize directly from a file using json4s, or is the only way to read into memory first?