Как я могу получить длину в байтах строкового потока.
stringstream.str().length();
скопирует содержимое в std::string. Я не хочу делать копию.
Или, если кто-то может предложить другой iostream, который работает в памяти, может быть передан для записи в другой ostream и может легко получить его размер, я буду использовать его.