Open JanecekPetr opened 2 years ago
so there are 3 methods to be implemented: lines()
, readAllLines()
and getLineNumber()
. Right?
Not really. I will say lines()
definitely is needed to bring LineReader
to where BufferedReader
is. The other methods are up for a debate as they could be slightly controversial / unneeded:
readAllLines()
belongs here because CharStreams.readLines()
exists. Doing one thing multiple ways is usually frowned upon in good API design. That said, LineReader
kinda screams for the method. Not my call. This requires more API designing and discussions and, let's be frank, nobody is going to spend precious time on arguing whether the method belongs there or not, so it's not going to be there.Let's only focus on lines()
here.
Makes sense. So its lines()
for now.
Should I resolve it?
I have added the lines method in this pull request https://github.com/google/guava/pull/6142 Can anyone review it.
I have raised a cr for this.
LineReader
currently only has thereadLine()
method. However, already since Java 8 there's [lines()
](https://docs.oracle.com/en/java/javase/18/docs/api/java.base/java/io/BufferedReader.html#lines()), too.Not to mention that it'd be nice to also maybe have
readAllLines()
and maybe even agetLineNumber()
fromLineNumberReader
.Yes, I know, there's
CharStreams.readLines()
, that's fine.