ofBuffer: optimize iterators and read from istream