delete temporary file in java

前端 未结 4 1462
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 23:26

I\'m creating temporary file in java but i\'m unable to delete it. This is the code I have written:

temp = File.createTempFile(\"temp\", \".txt\");
temp.dele         


        
4条回答
  •  既然无缘
    2021-01-03 23:47

    Code to close the inpustream and outputstream:

        FileInputStream in = new FileInputStream();
    
         ArrayList list_in = new ArrayList();
    
         list_in.add(in);
    
         FileOutputStream out = new FileOutputStream();
    
         ArrayList list_out = new ArrayList();
    
         list_in.add(out);
    
         public do_before_exit()
         {
    
          for(int i=0;i

提交回复
热议问题