saving stream

various functionality to save the stream