avoid using auto close input stream