fun Reader.buffered( bufferSize: Int = DEFAULT_BUFFER_SIZE ): BufferedReader Returns a buffered reader wrapping this Reader, or this Reader itself if it is already buffered. | |
fun Reader.copyTo( out: Writer, bufferSize: Int = DEFAULT_BUFFER_SIZE ): Long Copies this reader to the given out writer, returning the number of characters copied. | |
fun Reader.forEachLine(action: (String) -> Unit) Iterates through each line of this reader, calls action for each line read and closes the Reader when it's completed. | |
fun Reader.readLines(): List<String> Reads this reader content as a list of lines. | |
fun Reader.readText(): String Reads this reader completely as a String. | |
fun <T> Reader.useLines(block: (Sequence<String>) -> T): T Calls the block callback giving it a sequence of all the lines in this file and closes the reader once the processing is complete. |
© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/java.io.-reader/index.html