srikandula
Programmer
Can any one help me in this problem ?
I have created an URL to get the information from some site say as
URL hp= new URL("http","
and opened the conenction as
URLConnection hpcon= hp.openConnection();
But when i am reading the information by using
String content="";
byte b[]= new byte[1024];
int nbytes;
BufferedInputStream in = new BufferedInputStream(hpcon.getInputStream(),2048);
while((nbytes =in.read(b,0,1024))!=-1){
content = new String(b,0,nbytes);
System.out.println("the info :"+ content);
}
I am getting the UnknownhostException turned on though my computer is connected to
the net.But when i am accessing the intrnal site i not getting any error message,so
how can i avoid the exception for the external sites avoiding this error.Can any one
please give the complete detailed information on this to me immediately.
I have created an URL to get the information from some site say as
URL hp= new URL("http","
and opened the conenction as
URLConnection hpcon= hp.openConnection();
But when i am reading the information by using
String content="";
byte b[]= new byte[1024];
int nbytes;
BufferedInputStream in = new BufferedInputStream(hpcon.getInputStream(),2048);
while((nbytes =in.read(b,0,1024))!=-1){
content = new String(b,0,nbytes);
System.out.println("the info :"+ content);
}
I am getting the UnknownhostException turned on though my computer is connected to
the net.But when i am accessing the intrnal site i not getting any error message,so
how can i avoid the exception for the external sites avoiding this error.Can any one
please give the complete detailed information on this to me immediately.