Protect the inputstream from being close as we try different ways of parsing the content.