Added utility method to read file objects into lines.