dump_stream function implemented