File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
jQuery in Action, 2nd edition
 
subject: File Reader(Urgent)