This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a simple question regarding urlConnection.getInputStream();
Referring to the bit of code below, my question is when does the data
come down from the remote server. When I call getInputStream?
Do the full results get sent at that time?
Or somewhere in the while loop?
If I check result.available() immediately after getInputStream() I get 0 zero.
Thought I would need to know this to put some error handling around this
thanks for your kind assistance.
URLConnection urlConnection = url.openConnection();
urlConnection.setConnectTimeout( 30 * 1000 ); // wait 30 seconds to connect
urlConnection.setReadTimeout( 120 * 1000 ); // wait 120 seconds for data to return