The std::ostream API is replaced with appending data directly to string to eliminate redundant string copying.