my dog learned polymorphism*
The moose likes I/O and Streams and the fly likes File Reader(Urgent) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "File Reader(Urgent)" Watch "File Reader(Urgent)" New topic
Author

File Reader(Urgent)

Angela D'souza
Ranch Hand

Joined: Jan 16, 2002
Posts: 469
Hello,
I want to know that which class I should use to read file from network(intranet) or internet?
Thanks,
Angela
Erick Jones
Ranch Hand

Joined: Jun 17, 2002
Posts: 38
Try the following:
URL url = new URL("http://www.javaranch.com");
InputStream stream = url.openStream();
Regards,
Erick
Angela D'souza
Ranch Hand

Joined: Jan 16, 2002
Posts: 469
Can I use Socket instead?
Erick Jones
Ranch Hand

Joined: Jun 17, 2002
Posts: 38
Sure. If you open a Socket connection, then you can use the getInputStream() method.
Angela D'souza
Ranch Hand

Joined: Jan 16, 2002
Posts: 469
Thanks,
Angela
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File Reader(Urgent)
 
Similar Threads
Ant error: Make sure you have it in you classpath
requested resource (first.jsp) not available
JMF
Adding a file to a program
File constructor