upgrade stream2buffer