stream inherits from EventEmitter to write data, and receive data