bstrlib - WIP - tested functions bstream