Here you can find the source of urlToReader(URL url)
public static Reader urlToReader(URL url) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; import java.net.URLConnection; public class Main { public static Reader urlToReader(URL url) throws IOException { // FIXME: character encoding should be read from response headers or // should default to ISO-8859-1 URLConnection con = url.openConnection(); return new InputStreamReader(con.getInputStream()); }// ww w . j a va 2 s. c o m }