Revert "remove null return from nextOrEndOfStream."

This reverts commit 1857573f458e7802ca46d08c41d262f892bfc3f9.