Here you can find the source of loadURL(String urlDesc)
public static StringBuffer loadURL(String urlDesc)
//package com.java2s; /** /* www. j av a 2s . com*/ * @author Dimitri Dean DARSEYNE (D3), * Published by Short-Circuit under Creative Commons (CC) Licensing: * Authorship/Paternity, NO Commercial Use, NO Derivative * Please check for more informations: * http://creativecommons.org/licenses/by-nc-nd/2.0/ * * Auteur Dimitri Dean DARSEYNE (D3), * Publi? par Short-Circuit sous license Creative Commons (CC): * Paternit?, PAS d'Utilisation Commerciale, pas de D?riv?s/Modifications * Pour plus d'informations, se rendre sur: * http://creativecommons.org/licenses/by-nc-nd/2.0/fr/ * * @since Short-Circuit 1999 */ import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; public class Main { public static StringBuffer loadURL(String urlDesc) { StringBuffer buffer = new StringBuffer(); try { URL urlContent = new URL(urlDesc); BufferedReader inBuf = new BufferedReader(new InputStreamReader(urlContent.openStream())); String strTemp; while ((strTemp = inBuf.readLine()) != null) buffer.append(strTemp + "\r\n"); inBuf.close(); //System.out.println("buf size " + buffer.length()); } catch (Exception e) { System.out.println("loadURL" + urlDesc + " : " + e.toString()); } return buffer; } }