title: unable to retrieve all data from httpResponse
body: <p>After I try different way, i cannot able to retrieve all data from <code>HttpResponse</code>.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>private static final DefaultHttpClient httpClient =
      new DefaultHttpClient();
  
  public void get() throws Exception {
      HttpPost httpPost = new HttpPost("https://dt.abc.net/abc.exe");
  
      httpPost.addHeader("Accept", "text/xml");
      httpPost.setHeader("Content-Type","application/xml;charset=UTF-8")
  
      List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
      nameValuePairs.add(new BasicNameValuePair("XML", 
              getRequestTypeStringBuilder()));
  
      // In here "XML" is parameter value that is required send to the server 
      // before request data from server.
  
      httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
      HttpParams params = new BasicHttpParams();
      HttpConnectionParams.setStaleCheckingEnabled(params, false);
      HttpConnectionParams.setConnectionTimeout(params, 5000);
      HttpConnectionParams.setSoTimeout(params, 5000);
      httpClient.setParams(params);
      httpClient.getParams().setParameter(
              ClientPNames.COOKIE_POLICY, CookiePolicy.RFC_2109);
      HttpResponse response = httpClient.execute(httpPost);
  
      InputStream is = response.getEntity().getContent();
  
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      byte[] buf;
      int ByteRead;
      buf = new byte[1024];
  
      String xmldata = null;
      while ((ByteRead = is.read(buf, 0, buf.length)) != -1) {
          os.write(buf, 0, ByteRead);
          totalSize += ByteRead;                      
      }
  
      xmldata =  os.toString().replaceAll(" ", "");
      os.close();
      is.close();
  }
  </code></pre>
  
  <p>A problem is, if i set content-type = "application/xml" and try to retrieve data  from remote server, which is in large amount, it could not retrieve all data. However, if data is reletively small, then it works perfect.</p>
  
  <p>All return data are in XML format</p>
  
  <p>Another problem if i change content-type="application/x-www-form-urlencoded", it throws and exception :</p>
  
  <pre><code>01-05 18:59:53.165: WARN/System.err(372): javax.net.ssl.SSLProtocolException: Read error: ssl=0x2f9698: Failure in SSL library, usually a protocol error
  01-05 18:59:53.195: WARN/System.err(372):     at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)
  01-05 18:59:53.208: WARN/System.err(372):     at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:786)
  01-05 18:59:53.215: WARN/System.err(372):     at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)
  01-05 18:59:53.236: WARN/System.err(372):     at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:134)
  01-05 18:59:53.236: WARN/System.err(372):     at org.apache.http.impl.io.IdentityInputStream.read(IdentityInputStream.java:86)
  01-05 18:59:53.246: WARN/System.err(372):     at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159)
  01-05 18:59:53.286: WARN/System.err(372):     at com.epsilon.android.dreammailandroid.remoteserver.AsyncDownloadDataInsert.doInBackground(AsyncDownloadDataInsert.java:111)
  01-05 18:59:53.295: WARN/System.err(372):     at com.epsilon.android.dreammailandroid.remoteserver.AsyncDownloadDataInsert.doInBackground(AsyncDownloadDataInsert.java:1)
  01-05 18:59:53.316: WARN/System.err(372):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
  01-05 18:59:53.316: WARN/System.err(372):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
  01-05 18:59:53.335: WARN/System.err(372):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
  01-05 18:59:53.335: WARN/System.err(372):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
  01-05 18:59:53.346: WARN/System.err(372):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
  01-05 18:59:53.396: WARN/System.err(372):     at java.lang.Thread.run(Thread.java:1019)
  01-05 18:59:55.764: WARN/InputManagerService(61): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4065a640
  </code></pre>
  
  <p>I couldn't understand why i couldn't get all data in response. </p>
  
  <p>Could you help me, figure out what is problem in my code.</p>
  
  <p>Note: I retrieve data from android application.</p>
  
  <p>Thank you,</p>
  
  <p>"May all being be happy"</p>
  
  <p>Regards and Metta,
  Ichirohang Limbu</p>