Optimized code for Reverse Address Java sample app.