SunTaag  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
URL, URLConnection in Java

import java.net.*;

import java.io.*;

 

public class URLRead {

public static void main(String[] args) throws Exception {

URL ocu = new URL("http://shiptaek.tistory.com/");

BufferedReader in = new BufferedReader(new InputStreamReader(ocu.openStream()));

String inputLine;

while ((inputLine = in.readLine()) != null)

System.out.println(inputLine);

in.close();

}

}

 

 

 

 

 

 

 

import java.net.*;

import java.io.*;

public class URLConnectionRead {

public static void main(String[] args) throws Exception {

URL ocu = new URL("http://shiptaek.tistory.com/");

URLConnection con = ocu.openConnection();

BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));

String inputLine;

while ((inputLine = in.readLine()) != null)

System.out.println(inputLine);

in.close();

}

}




BLOG main image
 Notice
 Category
분류 전체보기 (20)
Algorithm (3)
Signal Processing (0)
Programming (6)
Research (1)
Youtube (2)
ETC. (8)
 TAGS
 Calendar
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
 Recent Entries
 Recent Comments
 Archive
 Link Site
 Visitor Statistics
Total :
Today :
Yesterday :
rss