It's not clear to me what's the difference between:

file1.eachLine() { println it }

and

file1.withReader { reader ->
    while ((line = reader.readLine()) != null) {
        println line
    }
}

the output is the same.
Thank you.