Added stream reader convenience function.