https://www.apiref.com/cpp-zh/cpp/io/basic_stringstream.html
void strtest2()
{
char s[22] = "aabbccddeeff";
char d[22] = { 0 };
int xx;
stringstream x;
// std::cout << "Hello World!\n";
printf("%d \n", x.tellp());
printf("%d \n", x.tellg());
x.write(s, 12);
x.read(d, 3);
printf("%d \n", x.tellp());
printf("%d \n", x.tellg());
x.clear();
printf("%d \n", x.tellp());
printf("%d \n", x.tellg());
x.str(""); // reset buffer
printf("%d \n", x.tellp());
printf("%d \n", x.tellg());
}