This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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
 
Have you checked out Aspose?
 
subject: File Reader(Urgent)
 
It's not a secret anymore!