HttpURLConnection on android 2.3.5 and 2.3.6
<p>After upgrade to android 2.3.5 and 2.3.6, the code for android
HttpURLConnection class: urlconn.connect(), urlconn.getOutputStream()
and urlconn.getInputStream() becomes very slow (each command takes
more than 5 second, under version 2.3.2 or 2.2 it just take less than
1 sec).
Does any one has the same situation?</p>

<p>My codes looks like this:</p>

<pre><code>getUrl = new URL(url);
urlConn = (HttpURLConnection) getUrl.openConnection();

urlConn.setUseCaches(false);
urlConn.setRequestMethod(httpMethod.name());
urlConn.setConnectTimeout(HTTP_CONNECT_TIMEOUT);
urlConn.setReadTimeout(HTTP_READ_TIMEOUT);
urlConn.setDoInput(true);
if (requestBody != null)
       urlConn.setFixedLengthStreamingMode(requestBody.length());
if (!(httpMethod == HttpMethod.GET))
       urlConn.setDoOutput(true);

urlConn.connect();

if (requestBody != null) {
       osw = new OutputStreamWriter(urlConn.getOutputStream());
       osw.write(requestBody);
       osw.flush();
}

in = urlConn.getInputStream();
buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[256];
while ((nRead = in.read(data, 0, data.length)) != -1) {
       buffer.write(data, 0, nRead);
}
buffer.flush();
responseBody = buffer.toByteArray();
responseCode = urlConn.getResponseCode();
</code></pre>

<p>Regards,
Zheng</p>
