I have a huge file to read, more than 5GB. I need ...
# getting-started
e
I have a huge file to read, more than 5GB. I need to do some transformation over each line, convert into my data object and than persist.
File.forEachLine
is a good choice for that?
j
The function is correct, but I'd recommend using
Path.forEachLine
instead. Manipulating
Path
is usually preferred over
File
in new code
Note that Kotlin provides lots of useful extensions on
Path
that make it much more convenient to use than Java's
Files.doSomething(Path)
e
nice thanks