[FOLD] streambuf: fix and test