Added streams support + tests
Taking null contents in count
Code style & lint errors fixed.