January 2018
Intermediate to advanced
434 pages
14h 1m
English
There are a lot of ways to go about reading from a file, but it is very important to understand the motivation behind them so as to be able to use the correct one for our purpose:
import java.io.Fileimport java.io.InputStreamfun main(args: Array<String>) { val inputStream: InputStream = File("lorem.txt").inputStream() val inputString = inputStream.reader().use { it.readText() } println(inputString)}
Read now
Unlock full access