Here you can find the source of load(URL url)
static StringBuffer load(URL url)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.net.URL; public class Main { static StringBuffer load(URL url) { try {//w w w .ja va 2s . co m StringBuffer sb = new StringBuffer(); { byte[] buf = new byte[1024]; int n; InputStream is = url.openStream(); while (-1 != (n = is.read(buf))) { sb.append(new String(buf)); } } return sb; } catch (Exception e) { throw new RuntimeException("Failed to load " + url, e); } } }