Update Java example apps to reflect current best practices

* Use DXUtil to get input and output.
* Use high-level APIs (with automatic de/serialization) where possible.