import java.net.*; import java.io.*; class Comm { private String address; private URL url; private Proxy proxy; private BufferedReader buffer; public Comm( String address) { proxy = null; buffer = null; this.address = address; try{ url = new URL(address); }catch(Exception e){ ; } } public void connect() { try{ if(proxy == null) { URLConnection uc = url.openConnection(); buffer = new BufferedReader( new InputStreamReader( uc.getInputStream())); } else { } }catch(Exception e) { System.out.println("not Connect URL"); } } public void read() { if(buffer !=null) { try{ String temp; while( null !=(temp = buffer.readLine())) System.out.println(temp); buffer.close(); }catch(Exception e) { System.out.println("not read Line"); } } } public static void main(String args[]) { Comm com = new Comm("http://www2"); com.connect(); com.read(); } }