Explicitly close stream in hasContent