Quantcast
Channel: Read entire file in Scala? - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by Dzmitry Lazerka for Read entire file in Scala?

$
0
0

Just like in Java, using CommonsIO library:

FileUtils.readFileToString(file, StandardCharsets.UTF_8)

Also, many answers here forget Charset. It's better to always provide it explicitly, or it will hit one day.


Viewing all articles
Browse latest Browse all 20

Trending Articles