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
 Read your gmail using Java code     -  
 Write and Read to File In Java Example     -  
 simple code to read properties in java     -  
 Read list of files in java I/O code     -  
 Read double values type from file in java     -  
 stream operator     -  
 stream get filters     -  
 stream filter to append     -  
 BufferedReader.ready() true at end of stream ?     -  
 How to stream a live video from a dlink     -  

Topic Tags

Java Files and I/O