new BufferedReader(Reader in) : BufferedReader « java.io « Java by API






new BufferedReader(Reader in)

 


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class Main {

  public static void main(String[] args) throws Exception {
    URL url = new URL("http://localhost:1776");
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
    String line;
    while ((line = in.readLine()) != null) {
      System.out.println(line);
    }
    in.close();
  }
}

   
  








Related examples in the same category

1.new BufferedReader(FileReader fileReader)
2.new BufferedReader(InputStreamReader input)
3.BufferedReader: readLine()