Not sure if this is good policy. Assuming reads are expensive, it might be much more efficient to always do exactly one file system read per call to `refreshBuffer()`, that way you never call read when your buffer only has a few bytes left to fill up.