title: java.io.eofexception
body: <p>What does this error mean?</p>
  
  <p>Below is my logcat output:</p>
  
  <pre><code>01-23 17:09:29.120: W/System.err(24339): java.io.EOFException
  01-23 17:09:29.120: W/System.err(24339):    at libcore.io.Streams.readAsciiLine(Streams.java:203)
  01-23 17:09:29.120: W/System.err(24339):    at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:544)
  01-23 17:09:29.120: W/System.err(24339):    at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:784)
  01-23 17:09:29.120: W/System.err(24339):    at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
  01-23 17:09:29.120: W/System.err(24339):    at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
  01-23 17:09:29.130: W/System.err(24339):    at libcore.net.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:270)
  01-23 17:09:29.130: W/System.err(24339):    at com.sfcca.coverflow.Store$downloadMagazine.doInBackground(Store.java:881)
  01-23 17:09:29.130: W/System.err(24339):    at com.sfcca.coverflow.Store$downloadMagazine.doInBackground(Store.java:1)
  01-23 17:09:29.130: W/System.err(24339):    at android.os.AsyncTask$2.call(AsyncTask.java:264)
  01-23 17:09:29.130: W/System.err(24339):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
  01-23 17:09:29.130: W/System.err(24339):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
  01-23 17:09:29.130: W/System.err(24339):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
  01-23 17:09:29.130: W/System.err(24339):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  01-23 17:09:29.130: W/System.err(24339):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  01-23 17:09:29.130: W/System.err(24339):    at java.lang.Thread.run(Thread.java:856)
  </code></pre>
  
  <p>According to the logcat this is the part of the code whereby there's an error:
  I'm trying to retrieve image url from a server then download them</p>
  
  <pre><code>try {
                      HttpURLConnection conn = (HttpURLConnection) myFileUrl.openConnection();
                      conn.setDoInput(true);
                      conn.connect();
                      InputStream in = conn.getInputStream();
                      Log.i("im connected", "Download");
                      bmImg = BitmapFactory.decodeStream(in);
  
                      File filename;
                      try {
                           // GET EXTERNAL STORAGE, SAVE FILE THERE
                          File storagePath = new File(Environment.getExternalStorageDirectory(),"/Futsing/issue"+issueNumber+"/");
                          storagePath.mkdirs();
  
                          filename = new File(storagePath + "/page"+number+".jpg");
                          FileOutputStream out = new FileOutputStream(filename);
                          bmImg.compress(Bitmap.CompressFormat.JPEG, 90, out);
  
                          out.flush();
                          out.close();
                          in.close();
                          MediaStore.Images.Media.insertImage(getContentResolver(),filename.getAbsolutePath(), filename.getName(),
                                  filename.getName());          
  
  
                           // displayImage();
                      } catch (Exception e) {
                          e.printStackTrace();
                      }   
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
  </code></pre>