Hi,
I am using the following code to fetch HTML contents of a web page. How can I use byte stream to read web contents.
public static void main(String[] str) throws Exception
{
URL url = new URL("http://www.mysite.com/abc.html");
URLConnection conn = url.openConnection();
DataInputStream in = new DataInputStream ( conn.getInputStream ( ) ) ;
BufferedReader bf = new BufferedReader(new InputStreamReader(in));
String webContents="";
while(bf.ready())
{
webContents+=bf.readLine();
}
}
Thanks in advance.