chore(engine): close inputStream in resource util

related to #CAM-2357