use stream2buffer