provide optional limit parameter when reading in potentially large streams