IDGEN-31: finally close inputstream