Modernizing to use java.nio instead of java.io.