use std::stringstream::write