Added readAsStream function.