title: Check if an inputream is empty
body: <p>In my application I use socket to communication with another device how I can check if <code>inputStream</code> is <code>empty</code> ? In this line I have a 
  <code>java.net.SocketTimeoutException</code></p>
  
  <pre><code>while ((bytesRead = inputStream.read(content)) != -1) {
  </code></pre>