Java URL Connection urlToReader(URL url)

Here you can find the source of urlToReader(URL url)

Description

url To Reader

License

Open Source License

Declaration

public static Reader urlToReader(URL url) throws IOException 

Method Source Code

//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
}

Related

  1. urlContents(String urlString)
  2. urlExists(String urlString)
  3. URLExists(URL url, StringBuffer errorMsg)
  4. urlifyMap(Long nid, double latitude, double longitude)
  5. urlToHtm(String word, String findurl, String path)
  6. urlToString(String url)
  7. urlToText(@Nonnull String url)