상세 컨텐츠

본문 제목

Facade Pattern의 예

Java

by techbard 2016. 7. 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


///


반응형

관련글 더보기

댓글 영역