Basic Stream class copied from graph branch dotparser