// Create URL object
URL url = new
URL("http://tutorials.jenkov.com/javaconcurrency/index.html");
BufferedReader readr =
new BufferedReader(new InputStreamReader(url.openStream()));
// Enter filename in which you want to download
BufferedWriter writer =
new BufferedWriter(new FileWriter("C:\\Users\\DELL\\Desktop\\Download.html"));
// read each line from stream till end
String line;
while ((line = readr.readLine()) != null) {
writer.write(line);
Main problem is decoding the output that i read using reader.readline()