Switch to full style
General Java code examples
Post a reply

Read stream from URL using Java

Wed Feb 06, 2013 10:35 pm

Read stream from URL using Java
java code
import java.net.*;
import java.io.*;

public class URLReader {
public static void main(String[] args) throws Exception {
URL codemiles= new URL("http://www.codemiles.com/");
DataInputStream in = new DataInputStream(
codemiles.openStream());

String inputLine;

while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);

in.close();
}
}




Post a reply
  Related Posts  to : Read stream from URL using Java
 Write and Read to File In Java Example     -  
 Read your gmail using Java code     -  
 Read list of files in java I/O code     -  
 simple code to read properties in java     -  
 Read double values type from file in java     -  
 stream get filters     -  
 stream operator     -  
 stream filter to append     -  
 How to stream a live video from a dlink     -  
 BufferedReader.ready() true at end of stream ?     -  

Topic Tags

Java Files and I/O