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?.forEach(::println)
Hawk
10/25/2017, 4:47 PMIan
10/25/2017, 4:49 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 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 investigatinguseLines
takes in a lambda, specifically (Sequence<String>) -> T
, and handles cleanup for youIan
10/25/2017, 8:40 PMList
, so toList() worked out fine 🙂