2015. 1. 25. 17:51
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

package URL;

import java.io.InputStream;
import java.net.URL;

public class openStream {
    public static void main(String args[]){
        try {
            URL url=new URL("http://www.google.com");
            InputStream is=url.openStream();
           
            byte buffer[]=new byte[1024];
            int i;
            while((i=is.read(buffer))!=-1){
                System.out.write(buffer,0,i);
            }
        } catch (Exception e) {
                e.printStackTrace();
        }
    }
}

'Java' 카테고리의 다른 글

Runtime : addShutdownHook(Thread hook)  (0) 2015.01.28
Runtime : availableProcessors()  (0) 2015.01.28
URL : openConnection()  (0) 2015.01.25
URL : getAuthority()  (0) 2015.01.25
new URL(String spec) throws MalformedURLException  (0) 2015.01.25
Posted by af334