title: java: datainputstream: do read calls take up processor time while waiting for data?
body: <p>If I call read() on a DataInputStream, will it take up CPU cycles waiting for data or does it yield the current thread and get woken up by an interrupt signaling that data has arrived?</p>
  
  <p>My motivation is to determine whether or not a stream reader needs to be in its own thread.  A blocking read that takes up CPU time would not be ideal as this would hang the main thread.</p>
  
  <p>Related question: When a method is described as a blocking, does it IMPLY that the thread yields while waiting?  Or is there no contract/guarantee?  A method that constantly checks/polls for data still blocks, it sounds, to me.</p>