Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > speeding up URLConnection reading

Reply
Thread Tools

speeding up URLConnection reading

 
 
Chris Uppal
Guest
Posts: n/a
 
      11-13-2006
mark wrote:

> I have just made some measurements and the most time consuming is
> getting the message into the string. I am actually using:
>
> StringBuilder str = new StringBuilder();
> char[] b = new char[32678];
> Reader reader = new InputStreamReader(
> method.getResponseBodyAsStream(), method.getResponseCharSet());
> for (int n; (n = reader.read(b)) != -1 str.append(b, 0, n);
> String answer = str.toString();


I find it /very/ hard to believe that decoding ASCII-valued binary data into
ASCII-valued string data is slower than transmitting that data across a
network. I think you must have mis-measured somehow.

-- chris


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Speeding up reading from files Lew Java 11 01-25-2010 11:15 AM
speeding up reading files (possibly with cython) per Python 11 03-09-2009 01:55 PM
OutputStream from a URLConnection produces an OutOfMemory OutputStream from a URLConnection produces an OutOfMemory WinstonSmith_101@hotmail.com Java 2 10-25-2006 04:45 PM
Speeding up URLConnection mark13.pl@gmail.com Java 4 08-30-2006 06:34 PM
Speeding Up Reading URL content from web johnhurt@gmail.com Java 1 09-13-2005 07:12 AM



Advertisments