Http URL connection can't read completely
<p>I am facing with problem related Http Connection. 
MY code : </p>

<pre><code>URL url = null;
try {
    url = new URL(_url);
} catch (MalformedURLException e) {
}

if (url != null) {
    HttpURLConnection urlConn = null;
    InputStreamReader isr = null;
    try {
        urlConn = (HttpURLConnection)url.openConnection();
        urlConn.setRequestMethod("GET");
        urlConn.setConnectTimeout(45000);

        if(response == HttpURLConnection.HTTP_OK) {
            StringBuffer readData = new StringBuffer("");
            int size = 1024;
            char[] buffer = new char[size];
            int len;
            isr = new InputStreamReader(urlConn.getInputStream());
            while ((len = isr.read(buffer, 0, size)) &gt; 0) {
                readData.append(buffer, 0, len);
            }
        }
    } 
    catch(Exception e) {
    } 
    finally {
        if(urlConn != null) {

        try {
            urlConn.disconnect();
        } catch(Exception e) {            
        }
    }
    if(isr != null) {
        try {
           isr.close();
        } catch(Exception e) {                
        }            
    }
}
</code></pre>

<p>This code can't download data completely.
For example :
Total size to read       : 13901 bytes 
Above code can read size : 12937 bytes</p>

<p>What is wrong here ?</p>

<p>Please advice guys.</p>
