Improved documentation and fixed code violations in stream.php

Signed-off-by: Chanaka Indrajith <pe.chanaka.ck@gmail.com>