cpp/io/basic filebuf

is a std whose associated character sequence is a file. Both the input sequence and the output sequence are associated with the same file, and a joint file position is maintained for both operations.

The functions underflow and overflow / sync perform the actual I/O between the file and the get and put areas of the buffer. When is not, most implementations store multibyte characters in the file and a std facet is used to perform wide/multibyte character conversion.