title: ObjectInputStream readObject in while Loop
body: <p>Is it possible to read from <code>ObjectInputStream</code> in while loop which will terminate by exception thrown by socket timeout <code>socket.setSoTimeout(4000);</code>  </p>
  
  <pre><code>while(Object obj = ois.readObject()) {  &lt;-- Not Working
  //do something with object    
  }
  </code></pre>