[FOLD] use streambuf