Simple version of the unix wc utility implemented in Java