Hawk
10/25/2017, 4:44 PM.stream() it gives you a java stream not a kotlin list, you should be able to call .forEach { println(it) } directly on the collection.Shawn
10/25/2017, 4:45 PMprintln? Might he not need the list for something else?Shawn
10/25/2017, 4:46 PM.forEach(::println)Hawk
10/25/2017, 4:47 PMHawk
10/25/2017, 4:48 PMIan
10/25/2017, 4:49 PMIan
10/25/2017, 4:50 PMShawn
10/25/2017, 4:54 PMBufferedReader#lineSequence(), provided by Kotlin, but I’m not sure that’ll be terribly helpful if you can’t use any of the extension methodsIan
10/25/2017, 5:07 PMIan
10/25/2017, 5:08 PMShawn
10/25/2017, 5:10 PMWe suggest you try the method [useLines] instead which closes the stream when the processing is complete.
I’m not sure if this is directly relevant to you, but it may be worth investigatingShawn
10/25/2017, 5:11 PMuseLines takes in a lambda, specifically (Sequence<String>) -> T, and handles cleanup for youIan
10/25/2017, 8:40 PMList, so toList() worked out fine 🙂