Here you can find the source of readFileIntoString(URL url)
public static String readFileIntoString(URL url) throws IOException
//package com.java2s; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; public class Main { public static String readFileIntoString(URL url) throws IOException { final char[] buffer = new char[0x10000]; StringBuilder str = new StringBuilder(); Reader in = new InputStreamReader(url.openStream(), "UTF-8"); int read; do {/*from w ww.ja v a 2 s .c o m*/ read = in.read(buffer, 0, buffer.length); if (read > 0) { str.append(buffer, 0, read); } } while (read >= 0); return str.toString(); } }