43 std::istream
in (
out.rdbuf ());
46 out <<
"Anticonstitutionnellement is a big word!!!\n";
49 const char s[] =
"Le rat des villes et le rat des champs.";
55 if (
out.rdbuf ()->pubsetbuf (0, 128L))
56 std::cout <<
"Successfully allocated buffer.\n";
58 std::cerr <<
"Failed to allocate buffer.\n";
61 std::cout <<
in.rdbuf ();
70 std::cout <<
in.rdbuf( ) <<
'\n';
73 const std::streamsize pcount = std::streamsize (
out.rdbuf ()->pcount ());
75 std::cout <<
"Buffer size is " << pcount <<
'\n';
78 if (
out.rdbuf ()->pubsetbuf (0, pcount * 2L))
79 std::cout <<
"\nSuccessfully resized buffer to " << pcount * 2 <<
'\n';
81 std::cerr <<
"\nFailed to resize buffer to " << pcount * 2 <<
'\n';
87 std::cout <<
out.rdbuf ()->str ();
90 out.rdbuf ()->freeze (
false);