title: Response :java.net.SocketException: Unexpected end of file from server Java
body: <p>I got this error from my program when i am call a URL from URLConnector.. the URL is </p>
  
  <pre><code>http://192.168.2.107/cgi-bin/mediaFileFind.cgi?action=findFile&amp;object=27544704&amp;condition.Channel=0&amp;conditon.Dir[0]="/mnt/sd"&amp;condition.StartTime=2014-8-1 00:00:00&amp;condition.EndTime=2014-8-31 23:59:59
  </code></pre>
  
  <p>but when i capture HTTP using wire-shark then wire-shark the URl is loss 
  wire-shark capture only </p>
  
  <pre><code>  http://192.168.2.107/cgi-bin/mediaFileFind.cgi?action=findFile&amp;object=27544704&amp;condition.Channel=0&amp;conditon.Dir[0]="/mnt/sd"&amp;condition.StartTime=2014-8-1 00:00:00
  </code></pre>
  
  <p>only this URL </p>
  
  <p>my Java program is </p>
  
  <pre><code>public String intilizeObject(String IP, String user, String pass, String objectID, String dir, String startTime, String endTime) {
          String result = "";
          try {
              String URL = "http://" + IP + "/cgi-bin/mediaFileFind.cgi?action=findFile&amp;object=" + objectID + "&amp;condition.Channel=0&amp;conditon.Dir[0]=\"" + dir + "\"&amp;condition.StartTime=" + startTime + "&amp;condition.EndTime=" + endTime;           
              String authString = user + ":" + pass;
              byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
              String authStringEnc = new String(authEncBytes);
              URL url = new URL(URL);
              System.out.println(url);
              URLConnection urlConnection = url.openConnection();
              urlConnection.setRequestProperty("Authorization", "Basic " + authStringEnc);
  
              InputStream is = urlConnection.getInputStream();
              InputStreamReader isr = new InputStreamReader(is);
  
              int numCharsRead;
              char[] charArray = new char[1024];
              StringBuffer sb = new StringBuffer();
              while ((numCharsRead = isr.read(charArray)) &gt; 0) {
                  sb.append(charArray, 0, numCharsRead);
              }
              result = sb.toString();
  
          } catch (Exception e) {
              result = e.toString();
          }
          return result;
      }
  </code></pre>