The template class basic_stringbuf is derived from basic_streambuf and used to associate both input and output streams with an object o f class basic_string.
The class basic_stringbuf is derived from basic_streambuf to associate a stream with a basic_string object for in-core memory character manipulations.