Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

is there a faster html parsing mechanism than new URL()

 
Matt Horton
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I guess my title says it all... but I'm curious to see if there's a faster way to hit a page and parse a page than with code such as:

Thanks in advance...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be faster if you use InputStream methods - with a Reader, every byte gets evaluated as a Unicode character - very time consuming.
You can try reading into a byte[] until the read method returns -1
You might also be able to use HttpURLConnection to get a content-length and use that to create an optimum byte[]
Bill
 
Matt Horton
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks so much Bill! I'll try to give it a run tomorrow.
thanks again -Matt
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!