This isn't yet public API.
This relies on an unreleased Okio API.
This has a significant impact on performance. I measured parsing performance
improve from 89k ops/sec to 140k ops/sec on one benchmark.
This borrows from Gson's UnsafeAllocator. I didn't actually
borrow much from Gson's reflective type adapter, but I'll need
to review that in follow up to see if I forgot anything that
Gson covers.
Most interesting design decision here is that fields are
serialized in alphabetical order. Also we're pretty nice
around detecting field collisiosn and failing early.
This is similar to the way Gson does its type adapters: factories that
can delegate and compose.
It's different because annotations are fundamental to the design.
It's also different because there are no APIs to convert to and from
JSON on the central object: instead callers must get the JSON adapter
they're interested in and do that there. This is potentially more
efficient because applications can hold the adapter they need.