add stream support, closes #5