This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Performance Issue: HttpURLConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Performance Issue: HttpURLConnection" Watch "Performance Issue: HttpURLConnection" New topic

Performance Issue: HttpURLConnection

J You

Joined: Jul 31, 2001
Posts: 29
I am developing a server application, which has to query another server to get the info it needs. So, in my Servlet program, first I send request to the remote URL through HttpURLConnection.The code is like following:
String strURL = "...";
URL url = new URL(strURL);
conn = (HttpURLConnection)url.openConnection();
reader = new BufferedReader(new
while((line = reader.readLine())!=null){
//process the line

}catch(Exception e){
//do nothing
This approach works, but I found it is pretty slow. Most of time is spent on the statement to get the BufferedReader...
Any advice?
Nagendra Prasad
Ranch Hand

Joined: Jul 11, 2002
Posts: 219
Not sure this is what you are looking for:
but check this url pout:

Best Regards,<br />Nagendra Prasad.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Performance Issue: HttpURLConnection
It's not a secret anymore!