/ Published in: Java
                    
                                        
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
/**
* Main.java
*
* @author www.javadb.com
*/
public class Main {
/**
* Reads a web page into a StringBuilder object
* and prints it out to console along with the
* size of the page.
*/
public void getWebSite() {
try {
StringBuilder builder = new StringBuilder();
int byteRead;
while ((byteRead = buffer.read()) != -1)
builder.append((char) byteRead);
buffer.close();
ex.printStackTrace();
ex.printStackTrace();
}
}
/**
* Starts the program
*
* @param args the command line arguments
*/
new Main().getWebSite();
}
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                