What is the most efficient general purpose way of reading \"large\" files (which may be text or binary), without going into unsafe
territory? I was surprised ho
I don't think you can write code more efficient than that. fill_buf
on a BufReader
over a File
is basically just a straight call to read(2).
That said, BufReader
isn't really a useful abstraction when you use it like that; it would probably be less awkward to just call file.read(&mut buf)
directly.