Use std::istringstream, std::ostringstream instead of std::stringstream
when we don't need both input and output.