I am observing a strange behaviour with the java.io.BufferedReader's ready method which returns false inside Tomcat while it returns true when the same servlet is run within Jetty.
BufferedReader bufferedReader = httpRequest.getReader();
System.out.println(bufferedReader.ready());
/** Perform some read operation */
Output:
true //Jetty
false //Tomcat
I understand that the BufferedReader#ready method only indicates if the next read is not going to blocked for the input(true) or not(false), but I am failing to understand the difference in its behavior between the two web server environments.
If someone has already come across this situation before ,I need help in understanding this better ?
Thanks in advance.