Streamlined code using Java7 "try as resource" block.