Improve Java style
 * Use List rather than ArrayList
 * Close resources in a finally block
 * Use for-each rather than iterators
 * Use a Reader directly rather than InputStream+InputStreamReader