Java tutorial
//package com.java2s; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; public class Main { public static InputStream getInputStream(HttpURLConnection connection) { if (connection != null) { try { InputStream inputStream = connection.getInputStream(); return inputStream; } catch (IOException e) { e.printStackTrace(); } } return null; } }