Implement Stream class