Here you can find the source of readNetFile(String urlstr)
public static final String readNetFile(String urlstr)
//package com.java2s; import java.io.IOException; import java.io.InputStream; import java.net.URL; public class Main { public static final String readNetFile(String urlstr) { InputStream in = null;/*w w w.jav a2 s .c om*/ try { URL url = new URL(urlstr); in = url.openStream(); String txt = readText(in); return new String(txt.getBytes("ISO-8859-1"), "UTF-8"); } catch (Exception e) { e.printStackTrace(); return null; } finally { if (in != null) try { in.close(); } catch (Exception e) { } } } public static final String readText(InputStream in) throws IOException { if (in == null) return ""; int c = -1; StringBuffer buffer = new StringBuffer(); while ((c = in.read()) != -1) buffer.append((char) c); return buffer.toString(); } }