The following:
|
_ostream->rdbuf()->sputn(data, static_cast<std::streamsize>(size)); |
should error out (I guess
error(ReaderError::DataOverflow);?) if the
sputn call returns something other than
size. Same for the other
sputn calls.
This error is also not feasible to detect outside of the library. ofstream::good() doesn't work, it returns true even if sputn failed to complete fully.