use nio for readFromFile()