syedislam

Downloading from URL

Nov 22nd, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.net.MalformedURLException;
  5. import java.net.URL;
  6.  
  7. public class Test3 {
  8.     public static void main(String[] args) throws IOException {
  9.         URL gonnaNeedSomeWords = new URL("http://www0.cs.ucl.ac.uk/external/s.islam/4letterworkds.txt");
  10.         BufferedReader gitDemWards = new BufferedReader(new InputStreamReader(gonnaNeedSomeWords.openStream()));
  11.         StringBuilder content = new StringBuilder();
  12.         String line;
  13.         while ((line = gitDemWards.readLine()) != null) {
  14.             System.out.println(gitDemWards.readLine());
  15.         }
  16.  
  17.     }
  18.  
  19. }
Add Comment
Please, Sign In to add comment