Daily bit(e) of C++ | std::istreambuf_iterator, std::ostreambuf_iterator
Daily bit(e) of C++ #427, Reading and writing raw data from and to streams using std::istreambuf_iterator and std::ostreambuf_iterator.
A simple option to handle formatted I/O is using istream and ostream iterators.
However, both iterators will interpret special characters.
To address this, the standard library also offers istreambuf and ostreambuf iterators that instead operate on the stream buffer, without additional semantics.