A file is just a stream of bytes. A newline is a byte (or two
on Windows) just like any other byte. There's no way to find
a newline other than the read in the bytes until you find it.
Now, if you can do preprocessing, you could build an index
where lines start. Said preprocessing will take more time
than going through the file once though.