title: BufferedInputStream and Blocking
body: <p>I am using a <code>BufferedInputStream</code> to read from a socket. The <code>BufferedInputStream</code> reads as follows:</p>
  
  <pre><code>socketInput.read(replyBuffer, 0, 7);
  </code></pre>
  
  <p>It is instantiated by</p>
  
  <pre><code>socketInput = new BufferedInputStream(mySocket.getInputStream());
  </code></pre>
  
  <p><code>mySocket</code> is defined as <code>private Socket mySocket;</code></p>
  
  <p><code>mySocket</code> is instantiated by <code>mySocket = new Socket(ipAddress, port);</code></p>
  
  <p>I have verified that <code>mySocket</code> is connected to my device. I can send data to my device; however, I am not receiving from my device for unknown reasons but that is not the problem.</p>
  
  <p>I want my <code>BufferedInputStream</code> to return after say 100ms if it does not read any data. Can the <code>BufferedInputStream</code> be setup to do this? Right now, it blocks indefinitely.</p>