Revise functions in PathReadWrite

- Adjust implementations to avoid excessive vararg copies
- Remove options from forEachLine, it doesn't make much sense and
isn't consistent with the other read* functions.
- Revise inlineness of functions in PathReadWrite
- Compact implementations of those that are remained inline.
- Clarify docs of functions for reading the entire file

#KT-19192
This commit is contained in:
Ilya Gorbunov
2020-10-15 02:57:09 +03:00
parent a43cc0d1f9
commit fe098ec821
3 changed files with 34 additions and 20 deletions
@@ -35,7 +35,7 @@ class PathReadWriteTest {
writer.close()
val list = ArrayList<String>()
file.forEachLine(charset = Charsets.UTF_8, options = arrayOf(StandardOpenOption.READ)) {
file.forEachLine(charset = Charsets.UTF_8) {
list.add(it)
}
assertEquals(listOf("Hello", "World"), list)