title: Erro : java.io.IOException: Stream closed
body: <pre><code>      try{
          URLPath = "xxxxx";
          URL url = new URL(URLPath);
          uc = (HttpURLConnection) url.openConnection();
          uc.setReadTimeout(30000);//timeout set
  
          uc.connect();// connect
  
  
          fos = new FileOutputStream(savePath);
          InputStream in = uc.getInputStream();
          byte[] buffer = new byte[1024];
          int Length = 0;
          long FinishedLenth = 0;
  
          while((Length = in.read(buffer)) &gt; 0) {
              FinishedLenth = FinishedLenth + Length;
              fos.write(buffer, 0, Length);
          }
          in.close();
          uc.disconnect();
  
          fos.close();
        }
  </code></pre>
  
  <p>This is my download code.<br>
  And I have problem, when I download small file like 600mb ,<br>
  and no error happen.<br>
  But I download 2G up file size, and the error happened.   </p>
  
  <pre><code>java.io.IOException: Stream closed
  at java.io.BufferedInputStream.getBufIfOpen(Unknown Source)
  at java.io.BufferedInputStream.read(Unknown Source)
  at java.io.FilterInputStream.read(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)
  at Download_File.downloadFile(Download_File.java:66)
  at downloadFileFunctionThread.run(downloadFileFunctionThread.java:116)
  </code></pre>
  
  <p>This is error message, I google the error message.<br>
  I find some solution is socket close problem.<br>
  But the error happened when download large size file.<br>
  So I don't know how to solve the problem.<br>
  Thanks All.   </p>