Here you can find the source of openInputStream(URL url)
static InputStream openInputStream(URL url) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; public class Main { static InputStream openInputStream(URL url) throws IOException { URLConnection uRLConnection = url.openConnection(); uRLConnection.setRequestProperty("User-Agent", "Valve/Steam HTTP Client 1.0 (tenfoot)"); uRLConnection.setRequestProperty("Cookie", "birthtime=-3599; lastagecheckage=1-January-1970"); uRLConnection.setConnectTimeout(8000); uRLConnection.setReadTimeout(8000); return uRLConnection.getInputStream(); }//from ww w .j av a 2s. c o m }