c++ - Transfer specified number of bytes from one stringstream to another -
given
- a
size_t n(typically valued in millions) - a
stringstream a, containing many morenbytes - a pre-existing empty
stringstream b
what might way transfer n bytes a b?
i think following work
std::string s; s.resize(n); a.read(&s[0], n); b << s.rdbuf(); but isn't there way skip intermediate string s , transfer n bytes directly a b?
Comments
Post a Comment