Close file inputstream when data writting is done