#99: define 'endDataStream()', and implement stream functions