The write buffer is set up such that overflow() is already called when there is still room for one
character. If overflow() is not called with EOF as the argument, the corresponding character can be written to the write position because the pointer to the write position is not increased beyond the
end pointer. After the argument to overflow() is placed in the write position, the whole buffer can
be emptied.