Here you can find the source of getStream(URL url)
public static Reader getStream(URL url) throws IOException
//package com.java2s; /****************************************************************************** * Copyright (c) 2002 - 2006 IBM Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://w w w . j a v a2s.co m * IBM Corporation - initial API and implementation *****************************************************************************/ 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 getStream(URL url) throws IOException { URLConnection conn = url.openConnection(); conn.setDefaultUseCaches(false); conn.setUseCaches(false); return new InputStreamReader(conn.getInputStream()); } }