Using buffer_iterator to emit back rewritten buffer