added parse_stream method that parses file like objects