user3198603
user3198603

Reputation: 5826

Where from ServletRequest.getInputStream() reads the content?

i make upload file(size is heavy) request to webserver from browser.

I came to know on net that i can use ServletRequest.getInputStream() method to read it from input stream and then read it by line by line to avoid out of memory issues. I have question on method ServletRequst.getInputStream(). Does webserver stores the request on some file internally and then ServletRequest.getInputStream() read it from there . Is that correct ?

EDIT:- I am using tomcat server.

Upvotes: 0

Views: 530

Answers (1)

A4L
A4L

Reputation: 17595

As you say internally this implies it is implementation detail and you dont have to care about it.

You have on the other hand a specificationn, ist is the ServletRequest Interface, and it provides you with an InputStream, and this ist great! You wont run into memory problems if your read it in a proper way.

Whether it is correct or not is known only by the guys who write the server' code imnplementing the specification.

Upvotes: 2

Related Questions