use nio for readFromFile()

I have changed the readFromFile method to use the java.nio package. The same might be good for loadPatternTable and savePatternTable methods.