add string buffer and unit-test