aspose file tools*
The moose likes I/O and Streams and the fly likes Reading the file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading the file " Watch "Reading the file " New topic
Author

Reading the file

Jithesh Kumar
Ranch Hand

Joined: Mar 09, 2010
Posts: 46
Hi all,

How can we read the outputstream which we get as a response from webserver ?.
Actually i want to read the outputstream as i am getting a file as response?

Thanks in advance,

Jithesh
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Jithesh Kumar wrote:Hi all,

How can we read the outputstream which we get as a response from webserver ?.
Actually i want to read the outputstream as i am getting a file as response?

Thanks in advance,

Jithesh


Don't you mean InputStream ? The server wrote to an OutputStream (or equivalent) and you read the content from an InputStream. How you get access to this InputStream depends on what you are using to connect to the Web Server.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Jithesh Kumar
Ranch Hand

Joined: Mar 09, 2010
Posts: 46


what you are using to connect to the Web Server



I think we are connecting to the webserver using request and response. So the issue is to get the stream of response where the webserver is writing.
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Jithesh Kumar wrote:


what you are using to connect to the Web Server



I think we are connecting to the webserver using request and response. So the issue is to get the stream of response where the webserver is writing.


The detail matters. What exactly are you using to connect to the web server. If you are using a URLConnection then you can get the response from an InputStream. Check the Javadoc for URLConnection, HttpURLConnection and HttpsURLConnection.
Jithesh Kumar
Ranch Hand

Joined: Mar 09, 2010
Posts: 46
thank you for responding.

for communicating a servlet with another servlet (in same webserver)if i use HttpURLConnection, can we send the request object from one servlet to another servlet or i have to send each parameter one by one to another servlet ?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Jithesh Kumar wrote:thank you for responding.

for communicating a servlet with another servlet (in same webserver)if i use HttpURLConnection, can we send the request object from one servlet to another servlet or i have to send each parameter one by one to another servlet ?


You need to spend some time looking at the basics of Servlets.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading the file