티스토리 뷰

Java

Facade Pattern의 예

techbard 2016.07.22 17:53



# example


import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

import java.net.URL;


public class Main {


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

URL url = new URL("http://www.google.com");

BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));

String line;

while ((line = reader.readLine()) != null) {

   System.out.println(line);

}

reader.close();

    }

}



# 결과


<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="ko"><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title><script>(function(){window.google={kEI:'vtqRV8CuBcvL0ATWi76ADA',kEXPI:'750148,1351077,3700326,3700389,4026241,4029815,4031109,4032678,4036509,4036527,4038012,4039268,4043492,4045841,4048347,4052304,4052811,4053261,4057739,4061155,4061922,4063220,4063473,4063879,4064096,4064131,4064904,4065787,4065794,4065873,4066237,4066653,4067175,4067518,4067658,4067860,4067938,4068548,4068550,4068850,4069458,4069733,4069839,4069841,4069907,4069916,4070230,4070286,4070337,4070453,4070503,4070598,4070721,4071020,4071227,4071261,4071422,4071577,4071661,4071669,4072000,4072574,4072605,8300096,8300273,8502184,8503585,8504930,8505655,8505743,8505768,8505774,8505803,8505823,8505842,8505870,10200083',authuser:0,kscs:'c9c918f0_24'};google.kHL='ko';})();(function(){google.lc=[];google.li=0;google.getEI=function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI};google.getLEI=function(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid")));)a=a.parentNode;return b};google.https=function(){return"https:"==window.location.protocol};google.ml=function(){return null};google.wl=function(a,b){try{google.ml(Error(a),!1,b)}catch(c){}};google.time=function(){return(new Date).getTime()};google.log=function(a,b,c,e,g){a=google.logUrl(a,b,c,e,g);if(""!=a){b=new Image;var d=google.lc,f=google.li;d[f]=b;b.onerror=b.onload=b.onabort=function(){delete


///


댓글
댓글쓰기 폼
공지사항
Total
394,929
Today
0
Yesterday
28
«   2018/11   »
        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  
글 보관함