> So I have the following code...
>
>               StringBuilder sb = new StringBuilder(4096);
>
>               while (true) {
>                       int i = in.read();
>                       if (i == 0)
>                           break;
>                       else if (i == -1)
>                           throw new EOFException();
>                       sb.append((char)i);
>               }
>
> What I see (with thousands of times run) is that this code takes about
> 1ms for every 7-10 bytes read...  So reading just 10k takes almost a
> SECOND!

You could try:

http://www.exampledepot.com/egs/java.net/ReadFromURL.html

or:

http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

If you cannot get HttpsURLConnection to do what you want, you could try
switching to HttpClient and using the Response Handler pattern from:

http://hc.apache.org/httpcomponents-client/examples.html

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to